/* Auth Container & Card */
.auth-container {
    position: relative;
    overflow: hidden;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(224, 122, 95, 0.25), transparent),
        radial-gradient(800px 420px at 0% 10%, rgba(242, 166, 90, 0.18), transparent),
        #16110d;
    padding: clamp(0.45rem, 1.2vh, 0.9rem);
}

.auth-bg-tags {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
}

.auth-bg-tag {
    position: absolute;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    padding: 0.34rem 0.68rem;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    backdrop-filter: blur(2px);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.25);
}

.auth-bg-tag:nth-child(1) { top: 11%; left: 10%; transform: rotate(-10deg); }
.auth-bg-tag:nth-child(2) { top: 24%; left: 28%; transform: rotate(6deg); }
.auth-bg-tag:nth-child(3) { top: 40%; left: 8%; transform: rotate(-5deg); }
.auth-bg-tag:nth-child(4) { top: 58%; left: 24%; transform: rotate(8deg); }
.auth-bg-tag:nth-child(5) { top: 74%; left: 12%; transform: rotate(-8deg); }
.auth-bg-tag:nth-child(6) { top: 16%; right: 10%; transform: rotate(9deg); }
.auth-bg-tag:nth-child(7) { top: 38%; right: 18%; transform: rotate(-7deg); }
.auth-bg-tag:nth-child(8) { top: 68%; right: 8%; transform: rotate(7deg); }
.auth-bg-tag:nth-child(9) { top: 82%; right: 24%; transform: rotate(-6deg); }
.auth-bg-tag:nth-child(10) { top: 8%; left: 44%; transform: rotate(5deg); }

.auth-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(5, 3, 20, 0.4);
    backdrop-filter: blur(4px);
    padding: clamp(1.05rem, 1.9vh, 1.8rem);
    max-width: 440px;
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

.auth-card-register {
    max-width: 500px;
}

@media (max-width: 900px) {
    .auth-bg-tag {
        font-size: 0.7rem;
        opacity: 0.8;
    }
}

@media (max-width: 640px) {
    .auth-bg-tag:nth-child(2),
    .auth-bg-tag:nth-child(4),
    .auth-bg-tag:nth-child(6),
    .auth-bg-tag:nth-child(8),
    .auth-bg-tag:nth-child(10) {
        display: none;
    }
}

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

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: clamp(0.62rem, 1.3vh, 1.15rem);
}

.auth-wordmark {
    display: block;
    width: min(182px, 92%);
    height: auto;
    margin: 0 auto 0.42rem;
}

.auth-header h2 {
    margin: 0 0 0.42rem 0;
    font-size: clamp(1.2rem, 2.2vh, 1.55rem);
    font-weight: 700;
    color: #1f2937;
    line-height: 1.15;
}

.auth-subtitle {
    margin: 0;
    font-size: clamp(0.78rem, 1.35vh, 0.88rem);
    color: #6b7280;
    line-height: 1.32;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1.1vh, 0.82rem);
}

/* Form Fields */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.34rem;
}

.form-label {
    font-size: clamp(0.78rem, 1.35vh, 0.88rem);
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}

.form-input {
    border: 2px solid #e5e7eb;
    border-radius: 7px;
    padding: clamp(0.46rem, 1.02vh, 0.66rem) 0.86rem;
    font-size: clamp(0.84rem, 1.45vh, 0.94rem);
    outline: none;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-input:focus {
    border-color: #e07a5f;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.1);
}

.form-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: -0.25rem;
}

.password-rules {
    margin-top: 0.05rem;
    display: grid;
    gap: 0.2rem;
}

.password-rules-title {
    font-size: 0.77rem;
    color: #6b7280;
    font-weight: 600;
}

.password-rule-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: #64748b;
}

.password-rule-item input[type="checkbox"] {
    width: 0.82rem;
    height: 0.82rem;
    pointer-events: none;
}

.password-rule-item.is-met {
    color: #166534;
    font-weight: 600;
}

.page.theme-dark .password-rules-title,
.page.theme-dark .password-rule-item {
    color: #cbd5e1;
}

.page.theme-dark .password-rule-item.is-met {
    color: #86efac;
}

/* Alerts */
.alert {
    padding: 0.5rem 0.72rem;
    border-radius: 7px;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    animation: slideInDown 0.3s ease-out;
}

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

/* Countdown (for registration success) */
.countdown {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    opacity: 0.9;
}

.countdown #countdown {
    font-weight: 700;
    font-size: 1rem;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 7px;
    padding: clamp(0.42rem, 0.95vh, 0.62rem) 1rem;
    font-size: clamp(0.84rem, 1.45vh, 0.92rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #e07a5f 0%, #f2a65a 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(224, 122, 95, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(224, 122, 95, 0.4);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #fff;
    color: #e07a5f;
    border: 2px solid #e07a5f;
}

.btn-secondary:hover {
    background: #f3f4ff;
    transform: translateY(-2px);
}

.btn-primary,
.btn-secondary {
    background: linear-gradient(135deg, #e07a5f 0%, #f2a65a 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(224, 122, 95, 0.3) !important;
}

.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(224, 122, 95, 0.4) !important;
    filter: brightness(1.04);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.34rem 0 0.2rem;
}

.auth-divider span {
    background: transparent;
    padding: 0;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-forgot-row {
    margin-top: -0.06rem;
    margin-bottom: 0.14rem;
}

.auth-forgot-row > a {
    font-size: 0.9rem;
    font-weight: 600;
}

.account-security-card {
    display: grid;
    gap: 1.1rem;
}

.account-security-section {
    border: 1px solid #f0e3cb;
    border-radius: 14px;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #fffaf0 52%, #fff7ed 100%);
}

.account-security-section-header {
    margin-bottom: 0.8rem;
}

.account-security-section-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.account-security-section-header p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: #64748b;
}

.account-security-checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.account-security-checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
}

.page.theme-dark .account-security-section {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.34);
}

.page.theme-dark .account-security-section-header h3 {
    color: #e2e8f0;
}

.page.theme-dark .account-security-section-header p {
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 0.5rem;
    }

    .auth-card,
    .auth-card-register {
        max-width: 100%;
        padding: 0.82rem 0.85rem;
        border-radius: 12px;
    }

    .auth-bg-tags {
        opacity: 0.35;
    }
}

@media (max-height: 900px) {
    .auth-bg-tags {
        opacity: 0.3;
    }

    .auth-bg-tag {
        padding: 0.2rem 0.45rem;
        font-size: 0.64rem;
    }

    .auth-card,
    .auth-card-register {
        padding: 0.75rem 0.85rem;
    }

    .auth-wordmark {
        width: min(145px, 85%);
    }
}