/* =========================================================
   AUTH / LOGIN PAGE
   GroveIt - Responsive Centered Layout
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    background: #000000;
}

/* =========================================================
   ACCESSIBLE RADIO INPUTS
   ========================================================= */

.hidden-accessible {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   AUTH TABS
   ========================================================= */

.login-panel {
    display: block;
}

.register-panel {
    display: none;
}

input#tab_login:checked ~ .relative-container .login-panel {
    display: block;
}

input#tab_login:checked ~ .relative-container .register-panel {
    display: none;
}

input#tab_register:checked ~ .relative-container .login-panel {
    display: none;
}

input#tab_register:checked ~ .relative-container .register-panel {
    display: block;
}

/* Active tab
   HTML does not contain .tab-wrapper,
   so target the tab labels directly.
*/

input#tab_login:checked ~ div.mb-4 .tab-login {
    background: #0f172a;
    color: #ffffff;
    border-bottom: 2px solid #9acb7e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input#tab_login:checked ~ div.mb-4 .tab-register {
    background: transparent;
    color: #94a3b8;
    border-bottom: 2px solid transparent;
}

input#tab_register:checked ~ div.mb-4 .tab-register {
    background: #0f172a;
    color: #fcfcfc;
    border-bottom: 2px solid #8fdc69;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input#tab_register:checked ~ div.mb-4 .tab-login {
    background: transparent;
    color: #94a3b8;
    border-bottom: 2px solid transparent;
}

/* =========================================================
   LOGIN METHOD SWITCH
   ========================================================= */

.login-otp-form {
    display: block;
}

.login-password-form {
    display: none;
}

.login-radio-group:has(#login_otp_radio:checked)
~ .form-switch-area
.login-otp-form {
    display: block;
}

.login-radio-group:has(#login_otp_radio:checked)
~ .form-switch-area
.login-password-form {
    display: none;
}

.login-radio-group:has(#login_pass_radio:checked)
~ .form-switch-area
.login-otp-form {
    display: none;
}

.login-radio-group:has(#login_pass_radio:checked)
~ .form-switch-area
.login-password-form {
    display: block;
}

/* =========================================================
   REGISTER METHOD SWITCH
   ========================================================= */

.reg-otp-form {
    display: block;
}

.reg-password-form {
    display: none;
}

.register-radio-group:has(#reg_otp_radio:checked)
~ .form-switch-area-reg
.reg-otp-form {
    display: block;
}

.register-radio-group:has(#reg_otp_radio:checked)
~ .form-switch-area-reg
.reg-password-form {
    display: none;
}

.register-radio-group:has(#reg_pass_radio:checked)
~ .form-switch-area-reg
.reg-otp-form {
    display: none;
}

.register-radio-group:has(#reg_pass_radio:checked)
~ .form-switch-area-reg
.reg-password-form {
    display: block;
}

/* =========================================================
   RADIO GROUP
   ========================================================= */

.radio-group label {
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.radio-group input:checked + label {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #475569 !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* =========================================================
   INPUTS
   ========================================================= */

input:focus {
    outline: none;
}

input:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* =========================================================
   AUTH PANEL ANIMATION
   ========================================================= */

.login-panel,
.register-panel {
    animation: fadeSlide 0.3s ease-out;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* =========================================================
   OTP STEP
   ========================================================= */

.step-container {
    transition: all 0.3s ease;
}

.step-hidden {
    display: none;
}

.step-visible {
    display: block;
    animation: fadeSlide 0.3s ease-out;
}

.otp-input {
    letter-spacing: 4px;
    font-size: 1.25rem;
    text-align: center;
}

/* =========================================================
   BACK LINK
   ========================================================= */

.back-link {
    background: none;
    border: none;
    color: #10b981;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #34d399;
    text-decoration: underline;
}

/* =========================================================
   RESEND TIMER
   ========================================================= */

.resend-timer {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    text-align: center;
}

/* =========================================================
   BUTTON
   ========================================================= */

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* =========================================================
   LOADING SPINNER
   ========================================================= */

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    border-top-color: #000000;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   TOAST
   ========================================================= */

.toast-notification {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 999;
}

/* =========================================================
   CENTER AUTH FORM
   ========================================================= */

/*
   Desktop:
   Main content is centered horizontally and vertically.
*/

main {
    width: 100%;
}

main > div {
    width: 100%;
}

main > div > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Remove the desktop 1fr + 450px split.
   Keep the existing section and make it centered.
*/

main section {
    width: 100%;
    max-width: 450px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Auth card should never exceed viewport width */

.login-panel,
.register-panel {
    width: 100%;
}

.login-panel > div,
.register-panel > div {
    width: 100%;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Large desktop */

@media (min-width: 1280px) {
    main section {
        max-width: 460px;
    }
}

/* Tablet */

@media (max-width: 1023px) {
    main {
        min-height: calc(100vh - 64px);
    }

    main > div {
        min-height: calc(100vh - 64px);
        padding-top: 32px;
        padding-bottom: 32px;
    }

    main section {
        max-width: 460px;
    }
}

/* Mobile */

@media (max-width: 640px) {
    main > div {
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 24px;
        padding-bottom: 24px;
    }

    main section {
        width: 100%;
        max-width: 100%;
    }

    /* Tabs */

    .tab-login,
    .tab-register {
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: 12px !important;
    }

    /* Card */

    .login-panel > div,
    .register-panel > div {
        border-radius: 0;
    }

    /* Card header */

    .login-panel > div > div:first-child,
    .register-panel > div > div:first-child {
        padding: 18px 18px;
    }

    /* Form spacing */

    .form-switch-area,
    .form-switch-area-reg {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .login-radio-group,
    .register-radio-group {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    /* Footer */

    .login-panel > div > div:last-child,
    .register-panel > div > div:last-child {
        padding-left: 18px;
        padding-right: 18px;
    }

    /* OTP */

    .otp-input {
        font-size: 1.15rem;
        letter-spacing: 3px;
    }

    /* Toast */

    .toast-notification {
        top: 16px;
        left: 16px;
        right: 16px;
        width: auto;
        transform: translateY(20px);
    }
}

/* Small mobile */

@media (max-width: 380px) {
    main > div {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .form-switch-area,
    .form-switch-area-reg {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .login-radio-group,
    .register-radio-group {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .tab-login,
    .tab-register {
        gap: 5px !important;
        font-size: 11px !important;
    }
}