/**
 * Auth forms (login / forgot password / register / set password)
 *
 * Shared by the header login modal (.sq-auth--modal) and the My Account page
 * (.sq-auth--page). Markup comes from includes/auth-forms.php, behaviour from
 * assets/js/auth-forms.js. Layout around the forms (modal overlay, account card,
 * grid) stays in each block's own stylesheet.
 */

/* Elements toggled with the [hidden] attribute */
.sq-auth [hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------------------
 * Form section (left column of the login layout)
 * ------------------------------------------------------------------------- */
.sq-auth.login-form-section {
    padding: 48px 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #FFFFFF;
}

/* View switching */
.sq-auth__view {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sq-auth__view.active {
    display: block;
    opacity: 1;
}

/* ---------------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------------- */
.sq-auth__title,
.sq-auth__subtitle {
    font-family: 'Kollektif', Georgia, serif;
    line-height: 1.5;
    color: #343434;
    font-weight: 400;
}

.sq-auth__title {
    font-size: 48px;
    margin: 0 0 8px 0;
}

.sq-auth__subtitle {
    margin: 0 0 12px 0;
}

.sq-auth__description {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #828282;
    margin: 0 0 32px 0;
}

.sq-auth--modal .sq-auth__subtitle {
    font-size: 22px;
}

.sq-auth--modal .sq-auth__description {
    line-height: 1.1;
}

.sq-auth--page .sq-auth__subtitle {
    font-size: 28px;
    margin: 0 0 8px 0;
}

.sq-auth--page .sq-auth__description {
    line-height: 1.4;
}

/* ---------------------------------------------------------------------------
 * Messages (errors / success)
 * ------------------------------------------------------------------------- */
.sq-auth__message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FEE;
    border: 1px solid #dc3545;
    border-radius: 8px;
    margin-bottom: 24px;
    animation: sqAuthSlideIn 0.3s ease-out;
}

.sq-auth__message-icon {
    flex-shrink: 0;
    color: #dc3545;
}

.sq-auth__message-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #dc3545;
    font-weight: 500;
}

/* Errors on the forgot / register / set-password views use a slightly deeper tint */
.sq-auth__view:not(.sq-auth__view--login) .sq-auth__message.is-error {
    background: #f8d7da;
}

.sq-auth__message.is-success {
    background: #d4edda;
    border-color: #28a745;
}

.sq-auth__message.is-success .sq-auth__message-icon {
    color: #28a745;
}

.sq-auth__message.is-success .sq-auth__message-text {
    color: #333333;
    font-weight: 400;
}

@keyframes sqAuthSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------------------------------------------------------------------
 * Form
 * ------------------------------------------------------------------------- */
.sq-auth__form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 320px;
}

.sq-auth .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sq-auth .form-field label {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #1E1E1E;
    font-weight: 400;
}

.sq-auth .form-field .input {
    padding: 12px 16px;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1;
    color: #1E1E1E;
    background: #FFFFFF;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.sq-auth .form-field .input::placeholder {
    color: #B3B3B3;
}

.sq-auth .form-field .input:focus {
    outline: none;
    border-color: #343434;
}

.sq-auth--page .form-field .input:focus {
    box-shadow: 0 0 0 3px rgba(52, 52, 52, 0.1);
}

/* Password field with show/hide toggle */
.sq-auth .password-field {
    position: relative;
}

.sq-auth .password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sq-auth .password-input-wrapper .input {
    width: 100%;
    padding-right: 48px;
}

.sq-auth .password-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.sq-auth .password-toggle:hover {
    opacity: 0.7;
}

.sq-auth .password-toggle:focus {
    outline: 2px solid #343434;
    outline-offset: 2px;
}

.sq-auth .password-toggle .eye-icon {
    width: 20px;
    height: 20px;
}

/* One-time password field (shown when the server asks for a code) */
.sq-auth .otp-field {
    animation: sqAuthSlideDown 0.3s ease-out;
}

.sq-auth .otp-field .field-description {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    margin-top: 6px;
    margin-bottom: 0;
}

.sq-auth .otp-field input {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5em;
    text-align: center;
}

@keyframes sqAuthSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        margin-top: inherit;
    }
}

/* Primary button (with loading state) */
.sq-auth .button-primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #343434;
    border: 1px solid #2C2C2C;
    border-radius: 8px;
    color: #F5F5F5;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
    width: 100%;
}

.sq-auth .button-primary:hover {
    background: #2C2C2C;
    transform: translateY(-1px);
}

.sq-auth .button-primary:active {
    transform: translateY(0);
}

.sq-auth .button-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.sq-auth .button-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Links */
.sq-auth .form-links {
    margin-top: -8px;
}

.sq-auth--page .form-links {
    text-align: center;
}

.sq-auth .text-link {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #1E1E1E;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.sq-auth .text-link:hover {
    opacity: 0.7;
}

.sq-auth .register-link {
    margin-top: 8px;
}

/* ---------------------------------------------------------------------------
 * Bot protection
 * ------------------------------------------------------------------------- */

/* Honeypot: off-screen (not display:none, which simple bots skip) */
.sq-auth__hp {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* CAPTCHA mount point: takes no space until the widget is rendered */
.sq-auth__captcha:empty {
    display: none;
}

/* ---------------------------------------------------------------------------
 * Image column (right side, shared by both layouts)
 * ------------------------------------------------------------------------- */
.login-image-section {
    position: relative;
    overflow: hidden;
    border-radius: 0 8px 8px 0;
}

.modal-background-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sq-auth.login-form-section {
        padding: 40px 32px;
    }

    .sq-auth__title {
        font-size: 40px;
    }

    .sq-auth--modal .sq-auth__subtitle {
        font-size: 20px;
    }

    .sq-auth--page .sq-auth__subtitle {
        font-size: 24px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .sq-auth.login-form-section {
        padding: 32px 24px;
        order: 1;
    }

    .login-image-section {
        display: none;
    }

    .sq-auth__title {
        font-size: 36px;
    }

    .sq-auth--modal .sq-auth__subtitle {
        font-size: 18px;
    }

    .sq-auth--page .sq-auth__subtitle {
        font-size: 22px;
    }

    .sq-auth__description {
        font-size: 13px;
    }

    .sq-auth__form {
        max-width: 100%;
    }
}

/* Small mobile (< 480px) */
@media (max-width: 480px) {
    .sq-auth.login-form-section {
        padding: 24px 20px;
    }

    .sq-auth__title {
        font-size: 32px;
    }

    .sq-auth--modal .sq-auth__subtitle {
        font-size: 16px;
    }

    .sq-auth--page .sq-auth__subtitle {
        font-size: 20px;
    }

    .sq-auth__description {
        font-size: 12px;
    }

    .sq-auth--modal .sq-auth__description {
        margin-bottom: 24px;
    }

    .sq-auth--page .sq-auth__description {
        margin-bottom: 20px;
    }

    .sq-auth .form-field label {
        font-size: 14px;
    }

    .sq-auth .form-field .input {
        font-size: 14px;
        padding: 10px 14px;
    }

    .sq-auth .button-primary {
        font-size: 14px;
        padding: 10px;
    }

    .sq-auth .text-link {
        font-size: 14px;
    }
}
