/* =============================================
   Auth Pages — Login, Register, ForgotPassword
   ============================================= */

/* Auth background on the full body */
body.auth-body {
    background: #f9fafb;
}

/* Page wrapper */
.auth-page {
    display: flex;
    flex-direction: column;
}

/* Center area */
.auth-center {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px 80px;
}

/* Card */
.auth-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 30px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.1);
    max-width: 448px;
    width: 100%;
    padding: 41px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Header (title + subtitle) */
.auth-card__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-card__header .auth-title {
    font-size: 30px;
    font-weight: 700;
    color: #101828;
    text-align: center;
    margin: 0;
}

.auth-card__header .auth-subtitle {
    font-size: 16px;
    color: #6a7282;
    text-align: center;
    margin: 0;
}

/* Form — spaces fields, OR divider, and Google button */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Fields group */
.auth-card__fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Footer section */
.auth-card__footer { 
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Individual field wrapper */
.auth-field {
    display: flex;
    flex-direction: column;
}

/* Input + icon wrapper — icons are positioned relative to this */
.auth-input-wrap {
    position: relative;
}

/* Label */
.auth-label {
    display: block;
    color: #101828;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Input */
.auth-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    height: 48px;
    padding-left: 48px;
    padding-right: 16px;
    font-size: 16px;
    color: #101828;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.auth-input::placeholder {
    color: rgba(10, 10, 10, 0.5);
}

.auth-input:focus {
    border-color: #8a1538;
}

/* Static icon inside input */
.auth-input-icon {
    position: absolute;
    left: 16px;
    top: 14px;
    width: 20px;
    height: 20px;
    pointer-events: none;
    color: #99a1af;
}

/* Password toggle eye button */
.auth-input-toggle {
    position: absolute;
    left: 16px;
    top: 14px;
    width: 20px;
    height: 20px;
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #99a1af;
    transition: color 0.2s;
}

.auth-input-toggle:hover,
.auth-input-toggle.active {
    color: #8a1538;
}


/* Primary button */
.auth-btn {
    background: #8a1538;
    color: #fff;
    border-radius: 14px;
    height: 48px;
    width: 100%;
    border: none;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 10px 15px rgba(138, 21, 56, 0.2), 0 4px 6px rgba(138, 21, 56, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    text-decoration: none;
}

.auth-btn:hover {
    background: #6d1029;
}

.auth-btn:disabled,
.auth-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner for loading state */
.auth-btn .auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
    display: none;
}

.auth-btn.loading .auth-spinner {
    display: block;
}

.auth-btn.loading .auth-btn-label {
    display: none;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* Google button */
.auth-btn-google {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    height: 48px;
    width: 100%;
    font-weight: 700;
    font-size: 14px;
    color: #101828;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.auth-btn-google:hover {
    background: #f9fafb;
}

/* OR divider */
.auth-or {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-or__line {
    background: #e5e7eb;
    height: 1px;
    flex: 1;
}

.auth-or__text {
    color: #99a1af;
    font-size: 14px;
    white-space: nowrap;
}

/* Forgot password link */
.auth-forgot {
    color: #8a1538;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.auth-forgot:hover {
    text-decoration: underline;
}

/* Remember me row */
.auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-remember__label {
    color: #6a7282;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.auth-remember__checkbox,
.auth-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #8a1538;
    cursor: pointer;
}

/* Bottom link row ("Don't have an account?") */
.auth-link-row {
    color: #6a7282;
    font-size: 14px;
    text-align: center;
}

/* Bottom action button — borderless variant (e.g., "Create account" on login) */
.auth-link-btn {
    background: #fff;
    border: none;
    color: #101828;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    display: block;
    width: 100%;
    padding: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-link-btn:hover {
    opacity: 0.75;
}

/* Bordered variant (e.g., "Login" button on register page) */
.auth-link-btn--bordered {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Back to login link */
.auth-back {
    color: #6a7282;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.auth-back:hover {
    color: #101828;
}

/* Forgot-password icon container */
.auth-forgot-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(138, 21, 56, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #8a1538;
}

/* Field error message */
.auth-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

/* Input error state */
.auth-input.has-error {
    border-color: #dc2626;
}

/* Global error banner (e.g., "Invalid email or password") */
.auth-error--global {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 12px 40px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #dc2626;
    font-size: 14px;
    position: relative;
}

.auth-error--global span {
    display: block;
    color: #dc2626;
    font-size: 14px;
    margin: 0;
}

.auth-error--global::before {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

/* Success banner — matches Figma toast design */
.auth-success-banner {
    background: #ecfdf3;
    border: 1px solid #bffcd9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 12px 40px 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #008a2e;
    font-size: 14px;
    position: relative;
}

.auth-success-banner__icon {
    display: none;
}

.auth-success-banner::before {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23008a2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

/* Optional page header wrapper */
.auth-page-header {
    width: 100%;
}

/* =============================================
   LTR overrides (EN) — icon on left side
   ============================================= */
[dir="ltr"] .auth-error--global,
[dir="ltr"] .auth-success-banner {
    padding: 12px 16px 12px 40px;
}

[dir="ltr"] .auth-error--global::before,
[dir="ltr"] .auth-success-banner::before {
    right: auto;
    left: 14px;
}

/* =============================================
   RTL overrides
   ============================================= */
[dir="rtl"] .auth-input {
    padding-right: 48px;
    padding-left: 16px;
    text-align: right;
}

[dir="rtl"] .auth-input-icon {
    right: 16px;
    left: auto;
}

[dir="rtl"] .auth-input-toggle {
    right: 16px;
    left: auto;
}

[dir="rtl"] .auth-remember {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-back {
    flex-direction: row-reverse;
}

/* =============================================
   Responsive — Mobile (≤ 560px)
   ============================================= */
@media (max-width: 560px) {
    .auth-center {
        padding: 16px;
    }

    .auth-card {
        border-radius: 20px;
        padding: 24px;
    }
}
/* Tighten gap between footer links and the reCAPTCHA disclosure */
.auth-card .recaptcha-terms { margin-top: 4px; }
