/* BKZ Enrollment — baseball field + bases + HR animation */

.enroll-wrap {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2.5rem) clamp(0.5rem, 3vw, 1.5rem);
    min-height: 520px;
}

.enroll-layout {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.enroll-layout__svg {
    width: min(100%, 540px);
    height: auto;
    max-height: 95%;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.enroll-layout__runner {
    stroke-dasharray: 18 28;
    animation: enrollRunnerDash 7s linear infinite;
}

@keyframes enrollRunnerDash {
    to {
        stroke-dashoffset: -220;
    }
}

.enroll-layout__bases {
    position: absolute;
    inset: 0;
    max-width: 540px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.enroll-layout__base {
    position: absolute;
    width: 2.35rem;
    height: 2.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #1a1a1a;
    background: linear-gradient(145deg, #f5f0e6 0%, #d4c4a8 45%, #c9b896 100%);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.enroll-layout__base--home {
    left: 50%;
    bottom: 6%;
    transform: translate(-50%, 0) rotate(45deg);
    background: linear-gradient(145deg, #e63946, #b82e38);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    text-shadow: none;
    animation: enrollBasePulse 2.4s ease-in-out infinite;
}

.enroll-layout__base--1 {
    right: 10%;
    top: 52%;
    transform: translate(0, -50%) rotate(45deg);
}

.enroll-layout__base--2 {
    left: 50%;
    top: 8%;
    transform: translate(-50%, 0) rotate(45deg);
}

.enroll-layout__base--3 {
    left: 10%;
    top: 52%;
    transform: translate(0, -50%) rotate(45deg);
}

@keyframes enrollBasePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.45);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(230, 57, 70, 0);
    }
}

.enroll {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 2.25rem 2rem;
    background: rgba(26, 31, 46, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    overflow: visible;
}

.enroll__header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.enroll__label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--clr-accent, #e63946);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.enroll__title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.enroll__desc {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.9rem;
    margin: 0;
}

.enroll__section {
    margin-bottom: 1.25rem;
    padding: 1.35rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 4px solid rgba(255, 255, 255, 0.12);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.enroll__section--home {
    border-left-color: rgba(230, 57, 70, 0.85);
}

.enroll__section--first {
    border-left-color: rgba(250, 204, 21, 0.85);
}

.enroll__section--second {
    border-left-color: rgba(96, 165, 250, 0.85);
}

.enroll__section--third {
    border-left-color: rgba(74, 222, 128, 0.85);
}

.enroll__section:focus-within {
    box-shadow: 0 0 0 1px rgba(230, 57, 70, 0.25);
    border-left-color: var(--clr-accent, #e63946);
}

.enroll__section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--clr-accent, #e63946);
    margin-bottom: 1.1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.enroll__section-title svg {
    flex-shrink: 0;
}

.enroll__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.enroll__row:last-child {
    margin-bottom: 0;
}

.enroll__field--full {
    grid-column: 1 / -1;
}

.enroll__field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.enroll__field input,
.enroll__field select,
.enroll__field textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.enroll__field input::placeholder,
.enroll__field textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.enroll__field input:focus,
.enroll__field select:focus,
.enroll__field textarea:focus {
    outline: none;
    border-color: var(--clr-accent, #e63946);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.enroll__field select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.enroll__field select option {
    background: #1a1f2e;
    color: #fff;
}

.enroll__field textarea {
    resize: vertical;
    min-height: 80px;
}

.enroll__field.has-error input,
.enroll__field.has-error select,
.enroll__field.has-error textarea {
    border-color: #ff4444;
}

.enroll__error {
    display: none;
    font-size: 0.75rem;
    color: #ff4444;
    margin-top: 0.25rem;
}

.enroll__field.has-error .enroll__error {
    display: block;
}

.enroll__consent {
    margin: 1.25rem 0 1rem;
}

.enroll__consent.has-error {
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 68, 68, 0.35);
}

.enroll__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.enroll__checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.enroll__checkmark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    position: relative;
    transition: all 0.2s;
    margin-top: 1px;
}

.enroll__checkbox input:checked + .enroll__checkmark {
    background: var(--clr-accent, #e63946);
    border-color: var(--clr-accent, #e63946);
}

.enroll__checkbox input:checked + .enroll__checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.enroll__checkbox a {
    color: var(--clr-accent, #e63946);
    text-decoration: underline;
}

.enroll__submit {
    text-align: center;
}

.enroll__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.enroll__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.35);
}

.enroll__btn:active {
    transform: translateY(0);
}

.enroll__btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.enroll__btn svg {
    flex-shrink: 0;
}

.enroll__status {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.5em;
}

.enroll__status--success {
    color: #22c55e;
    padding: 1.5rem 1.25rem;
    background: rgba(34, 197, 94, 0.08);
    border-radius: 1rem;
    border: 1px solid rgba(34, 197, 94, 0.25);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.08);
    margin-top: 1.5rem;
    animation: enrollSuccessIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stanje nakon uspješne prijave: sakrij header forme i pozadinski diamond
   da ostane samo poruka o uspjehu (bez vizualne zbrke). */
.enroll-wrap--success {
    min-height: 0;
}

.enroll-wrap--success .enroll__header,
.enroll-wrap--success .enroll-layout {
    display: none;
}

.enroll-wrap--success .enroll {
    padding: 1.5rem 1.5rem 2rem;
}

.enroll-wrap--success .enroll__status {
    margin-top: 0;
}

.enroll__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.enroll__success-icon {
    color: #22c55e;
    filter: drop-shadow(0 4px 12px rgba(34, 197, 94, 0.4));
    animation: enrollSuccessIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.enroll__success-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.enroll__success-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    line-height: 1.55;
    max-width: 32rem;
}

@keyframes enrollSuccessIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes enrollSuccessIconPop {
    0% {
        transform: scale(0.3) rotate(-15deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.15) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.enroll__status--error {
    color: #ff4444;
    padding: 1rem;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.enroll__status--loading {
    color: rgba(255, 255, 255, 0.6);
}

/* —— HOME RUN overlay —— */
.enroll-hr {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border-radius: 1.5rem;
    overflow: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.enroll-wrap--hr .enroll-hr {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.enroll-hr__flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 85%, rgba(255, 220, 120, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 30% 20%, rgba(230, 57, 70, 0.2) 0%, transparent 40%),
        rgba(10, 14, 22, 0.88);
    opacity: 0;
}

.enroll-wrap--hr .enroll-hr__flash {
    animation: enrollHrFlash 0.45s ease-out forwards;
}

@keyframes enrollHrFlash {
    0% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 0.85;
    }
}

.enroll-hr__ball {
    position: absolute;
    left: 50%;
    bottom: 18%;
    width: 28px;
    height: 28px;
    margin-left: -14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 0%, #f8f4e8 25%, #c41e3a 28%, #c41e3a 42%, #fff 43%, #fff 46%, #c41e3a 47%, #c41e3a 55%, #fff 56%, #fff 58%, #c41e3a 59%, #8b0000 100%);
    box-shadow: 0 0 20px rgba(255, 200, 100, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    z-index: 2;
}

.enroll-wrap--hr .enroll-hr__ball {
    animation: enrollHrBall 1.35s cubic-bezier(0.22, 0.85, 0.35, 1) forwards;
}

@keyframes enrollHrBall {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-11rem, -17rem) scale(0.35) rotate(720deg);
        opacity: 0;
    }
}

.enroll-hr__burst {
    position: relative;
    z-index: 3;
    font-size: clamp(3.5rem, 14vw, 6.5rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.06em;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.9), 0 0 40px rgba(230, 57, 70, 0.8), 0 4px 0 #b82e38, 0 8px 24px rgba(0, 0, 0, 0.6);
    transform: scale(0.3) rotate(-8deg);
    opacity: 0;
}

.enroll-wrap--hr .enroll-hr__burst {
    animation: enrollHrBurst 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s forwards;
}

@keyframes enrollHrBurst {
    0% {
        transform: scale(0.2) rotate(-12deg);
        opacity: 0;
    }
    55% {
        transform: scale(1.08) rotate(-4deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(-3deg);
        opacity: 1;
    }
}

.enroll-hr__tagline {
    position: relative;
    z-index: 3;
    margin: 0.75rem 0 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(12px);
}

.enroll-wrap--hr .enroll-hr__tagline {
    animation: enrollHrTag 0.5s ease 0.35s forwards;
}

@keyframes enrollHrTag {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .enroll-wrap {
        min-height: 440px;
    }

    .enroll-layout__svg {
        opacity: 0.55;
    }

    .enroll {
        padding: 1.5rem 1rem;
    }

    .enroll__row {
        grid-template-columns: 1fr;
    }

    .enroll__title {
        font-size: 1.35rem;
    }

    .enroll__btn {
        width: 100%;
        justify-content: center;
    }

    .enroll-layout__base--1 {
        right: 4%;
    }

    .enroll-layout__base--3 {
        left: 4%;
    }

    @keyframes enrollHrBall {
        0% {
            transform: translate(0, 0) scale(1) rotate(0deg);
            opacity: 1;
        }
        100% {
            transform: translate(-35vw, -48vh) scale(0.3) rotate(720deg);
            opacity: 0;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .enroll-layout__runner {
        animation: none;
        stroke-dasharray: 12 28;
    }

    .enroll-layout__base--home {
        animation: none;
    }

    .enroll-wrap--hr .enroll-hr__ball,
    .enroll-wrap--hr .enroll-hr__burst,
    .enroll-wrap--hr .enroll-hr__tagline,
    .enroll-wrap--hr .enroll-hr__flash {
        animation: none;
    }

    .enroll-wrap--hr .enroll-hr__ball {
        opacity: 0;
    }

    .enroll-wrap--hr .enroll-hr__burst {
        transform: scale(1) rotate(-3deg);
        opacity: 1;
    }

    .enroll-wrap--hr .enroll-hr__tagline {
        opacity: 1;
        transform: none;
    }

    .enroll-wrap--hr .enroll-hr__flash {
        opacity: 0.85;
    }

    .enroll__btn,
    .enroll__field input,
    .enroll__field select,
    .enroll__field textarea,
    .enroll__checkmark {
        transition: none;
    }
}
