/* Auth page: modern, responsive, aligned with premium site design, with rich animations */
.auth-wrapper {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 1;
}

.auth-bg-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.auth-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: pulseGlow 8s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.1) translate(20px, 20px);
        opacity: 0.6;
    }
}

.auth-bg-glow.glow-1 {
    width: 400px;
    height: 400px;
    background: rgba(var(--primary-rgb), 0.3);
    top: -10%;
    left: 10%;
    animation-delay: 0s;
}

.auth-bg-glow.glow-2 {
    width: 350px;
    height: 350px;
    background: rgba(var(--secondary-rgb), 0.2);
    bottom: -10%;
    right: 15%;
    animation-delay: -4s;
}

.auth-container {
    width: 100%;
    /* Genisletildi */
    max-width: 1080px;
    /* Sabit minimum yukseklik ile tam uyum */
    min-height: 640px;
    display: flex;
    background: rgba(14, 15, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-2xl);
    backdrop-filter: blur(24px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    /* Overlay uses absolute positioning within this */
    position: relative;
    animation: scaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* GLOBAL PROCESSING OVERLAY */
.auth-processing-overlay {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: rgba(14, 15, 22, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-processing-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-processing-overlay .loader-content {
    text-align: center;
    color: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.auth-processing-overlay.hidden .loader-content {
    transform: translateY(20px);
}

.auth-processing-overlay i {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(var(--primary-rgb), 0.5));
}

.auth-processing-overlay p {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #fff;
    margin: 0;
}

@keyframes scaleUp {
    0% {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Showcase Side (Left) */
.auth-showcase {
    flex: 0 0 35%;
    /* Sol taraf biraz daha kucultuldu */
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.12) 0%, rgba(14, 15, 22, 0.6) 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.showcase-content {
    position: relative;
    z-index: 2;
    max-width: 320px;
    margin: 0 auto;
    text-align: center;
}

.showcase-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--secondary-rgb), 0.1));
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary-light);
    margin: 0 auto 30px;
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.15);
    animation: floatIcon 6s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.15);
    }

    50% {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.25);
    }
}

.showcase-content h2 {
    font-size: 2.1rem;
    margin-bottom: 12px;
    background: linear-gradient(to right, #ffffff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    animation: fadeUp 0.6s forwards 0.2s;
    opacity: 0;
    transform: translateY(15px);
}

.showcase-content p {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.6;
    animation: fadeUp 0.6s forwards 0.3s;
    opacity: 0;
    transform: translateY(15px);
}

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

/* Form Side (Right) */
.auth-box-wrapper {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    width: 100%;
    /* Form icerik genisligi */
    max-width: 520px;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-form {
    transition: var(--transition);
    animation: fadeInForm 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes fadeInForm {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-form.hidden {
    display: none;
    animation: none;
}

.auth-box h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #fff;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
    text-align: center;
}

/* Staggered form elements */
.auth-form>* {
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

.auth-form>*:nth-child(1) {
    animation-delay: 0.1s;
}

.auth-form>*:nth-child(2) {
    animation-delay: 0.15s;
}

.auth-form form>*:nth-child(1) {
    animation-delay: 0.2s;
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

.auth-form form>*:nth-child(2) {
    animation-delay: 0.25s;
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

.auth-form form>*:nth-child(3) {
    animation-delay: 0.3s;
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

.auth-form form>*:nth-child(4) {
    animation-delay: 0.35s;
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

.auth-form>.auth-switch {
    animation-delay: 0.4s;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    /* Slightly larger label */
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    /* Ensure input wrapper takes full grid column width */
}

.input-icon-wrapper i {
    position: absolute;
    left: 16px;
    z-index: 2;
    pointer-events: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-icon-wrapper input {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 52px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 0 16px 0 48px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-icon-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    transition: opacity 0.3s ease;
}

.input-icon-wrapper input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px);
}

.input-icon-wrapper input:focus::placeholder {
    opacity: 0.5;
}

.input-icon-wrapper:focus-within i {
    color: var(--primary);
    transform: scale(1.1);
}

.form-group:focus-within label {
    color: var(--primary-light);
}

.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 6px;
    height: 52px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.captcha-box::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius);
}

.captcha-box img {
    height: 100%;
    width: 160px;
    border-radius: 4px;
    object-fit: cover;
    object-position: center;
    image-rendering: pixelated;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.captcha-box:hover img {
    opacity: 1;
}

.btn-refresh-captcha {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.btn-refresh-captcha:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #fff;
    border-color: rgba(124, 58, 237, 0.5);
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.btn-refresh-captcha:active {
    transform: rotate(90deg) scale(0.95);
}

.captcha-input-container {
    flex: 1;
    min-width: 0;
    /* Prevents flex flex-grow overflow on small screens */
}

/* Adjust input text size & height slightly to match the image box */
.captcha-input-container .input-icon-wrapper input {
    height: 52px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    user-select: none;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-footer a,
.auth-switch a {
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.form-footer a::after,
.auth-switch a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #fff;
    transition: width 0.3s ease;
}

.form-footer a:hover,
.auth-switch a:hover {
    color: #fff;
    transform: translateX(2px);
}

.form-footer a:hover::after,
.auth-switch a:hover::after {
    width: 100%;
}

.btn-block {
    width: 100%;
    height: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    border-radius: var(--radius);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.btn-block span {
    position: relative;
    z-index: 1;
}

.btn-block i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.btn-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.4);
}

.btn-block:hover i {
    transform: translateX(4px);
}

.btn-block:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

.auth-switch {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-switch i {
    margin-right: 6px;
    transition: transform 0.3s ease;
}

.auth-switch a:hover i {
    transform: translateX(-4px);
}

/* Closed Registration */
.registration-closed {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(239, 68, 68, 0.1));
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
    opacity: 1;
    animation: RegistrationShake 0.6s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes RegistrationShake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.closed-icon {
    font-size: 48px;
    color: var(--primary-light);
    margin-bottom: 16px;
    opacity: 0.9;
    animation: floatIcon 6s ease-in-out infinite;
}

.registration-closed h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.registration-closed p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* 2FA styling */
.auth-icon-wrapper {
    width: 72px;
    height: 72px;
    background: rgba(var(--primary-rgb), 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--primary);
    font-size: 28px;
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.2);
    animation: pulseIcon 2.5s infinite;
}

@keyframes pulseIcon {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(var(--primary-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

.otp-container {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 32px 0;
}

.otp-input {
    width: 100%;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius);
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.otp-input:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.25);
    transform: translateY(-4px) scale(1.05);
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .auth-container {
        flex-direction: column;
        max-width: 500px;
    }

    .auth-showcase {
        padding: 40px 30px 30px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .showcase-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 20px;
    }

    .showcase-content h2 {
        font-size: 1.8rem;
    }

    .showcase-content p {
        font-size: 0.95rem;
    }

    .auth-box-wrapper {
        padding: 40px 30px;
    }
}

@media (max-width: 576px) {
    .auth-wrapper {
        padding: 24px 16px;
        align-items: flex-start;
        min-height: calc(100vh - 120px);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-bg-glow.glow-1 {
        width: 250px;
        height: 250px;
    }

    .auth-bg-glow.glow-2 {
        width: 200px;
        height: 200px;
    }

    .auth-container {
        border-radius: var(--radius-xl);
        animation: scaleUpMobile 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    }

    @keyframes scaleUpMobile {
        0% {
            transform: scale(0.98) translateY(10px);
            opacity: 0;
        }

        100% {
            transform: scale(1) translateY(0);
            opacity: 1;
        }
    }

    .auth-showcase {
        padding: 30px 20px 20px;
    }

    .showcase-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
        margin-bottom: 16px;
    }

    .showcase-content h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .showcase-content p {
        display: none;
    }

    .auth-box-wrapper {
        padding: 30px 20px 35px;
    }

    .auth-box h2 {
        font-size: 1.6rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
        margin-bottom: 24px;
    }

    .captcha-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .captcha-box {
        width: 100%;
        height: 54px;
        padding: 6px;
        gap: 8px;
        justify-content: space-between;
    }

    .captcha-box img {
        width: 140px;
    }

    .btn-refresh-captcha {
        width: 40px;
        height: 40px;
    }

    .captcha-input-container .input-icon-wrapper input {
        height: 48px;
    }

    .btn-block {
        height: 48px;
    }

    .otp-container {
        gap: 8px;
    }

    .otp-input {
        height: 50px;
        font-size: 1.2rem;
        border-radius: 8px;
    }
}

/* Light mode harmonization */
:root[data-theme="light"] .auth-bg-glow.glow-1 {
    background: rgba(var(--primary-rgb), 0.2);
}

:root[data-theme="light"] .auth-bg-glow.glow-2 {
    background: rgba(var(--secondary-rgb), 0.15);
}

:root[data-theme="light"] .auth-container {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.14);
}

:root[data-theme="light"] .auth-processing-overlay {
    background: rgba(248, 250, 252, 0.86);
    backdrop-filter: blur(6px);
}

:root[data-theme="light"] .auth-processing-overlay p {
    color: #0f172a;
}

:root[data-theme="light"] .auth-showcase {
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.14) 0%, rgba(255, 255, 255, 0.84) 100%);
    border-right-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .showcase-content h2 {
    background: linear-gradient(to right, #0f172a, #6d28d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

:root[data-theme="light"] .showcase-content p {
    color: #475569;
}

:root[data-theme="light"] .auth-box h2 {
    color: #0f172a;
}

:root[data-theme="light"] .auth-subtitle,
:root[data-theme="light"] .auth-switch {
    color: #475569;
}

:root[data-theme="light"] .form-group label {
    color: #334155;
}

:root[data-theme="light"] .input-icon-wrapper i {
    color: #64748b;
}

:root[data-theme="light"] .input-icon-wrapper input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.16);
    color: #0f172a;
}

:root[data-theme="light"] .input-icon-wrapper input::placeholder {
    color: #94a3b8;
}

:root[data-theme="light"] .input-icon-wrapper input:hover {
    border-color: rgba(15, 23, 42, 0.24);
    background: #ffffff;
}

:root[data-theme="light"] .input-icon-wrapper input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.14);
}

:root[data-theme="light"] .form-group:focus-within label {
    color: #4c1d95;
}

:root[data-theme="light"] .captcha-box {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .captcha-box::before {
    box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .btn-refresh-captcha {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.14);
    color: #475569;
}

:root[data-theme="light"] .btn-refresh-captcha:hover {
    color: #4c1d95;
    background: rgba(124, 58, 237, 0.14);
    border-color: rgba(124, 58, 237, 0.32);
}

:root[data-theme="light"] .form-footer a,
:root[data-theme="light"] .auth-switch a {
    color: #6d28d9;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

:root[data-theme="light"] .remember-me {
    color: #334155;
}

:root[data-theme="light"] .form-footer a::after,
:root[data-theme="light"] .auth-switch a::after {
    display: none;
}

:root[data-theme="light"] .form-footer a:hover,
:root[data-theme="light"] .auth-switch a:hover {
    color: #4c1d95;
    background: rgba(109, 40, 217, 0.12);
    transform: translateY(-1px);
}

:root[data-theme="light"] .remember-me:hover {
    color: #1e293b;
}

:root[data-theme="light"] .registration-closed {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(239, 68, 68, 0.06));
    border-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .registration-closed h2 {
    color: #0f172a;
}

:root[data-theme="light"] .registration-closed p {
    color: #475569;
}

:root[data-theme="light"] .otp-input {
    border-color: rgba(15, 23, 42, 0.16);
    background: #ffffff;
    color: #0f172a;
}

:root[data-theme="light"] .otp-input:hover {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.24);
}

:root[data-theme="light"] .otp-input:focus {
    background: #ffffff;
}

@media (max-width: 992px) {
    :root[data-theme="light"] .auth-showcase {
        border-bottom-color: rgba(15, 23, 42, 0.1);
    }
}
