/* ========================================
   通行科技 - 登录/注册页面样式
   Design System: IBM Carbon-Inspired Light Theme
   ======================================== */

/* ========================================
   Auth Page Layout
   ======================================== */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    padding-bottom: 60px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* 背景装饰 */
.auth-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.auth-shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(15, 98, 254, 0.12);
    top: -100px;
    right: -100px;
    animation: floatShape 8s ease-in-out infinite;
}

.auth-shape-2 {
    width: 350px;
    height: 350px;
    background: rgba(138, 63, 252, 0.1);
    bottom: -80px;
    left: -80px;
    animation: floatShape 10s ease-in-out infinite reverse;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* ========================================
   Auth Card
   ======================================== */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 0 var(--space-lg);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    transition: box-shadow var(--transition-normal);
}

.auth-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, #161616 0%, #0f62fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
}

/* ========================================
   Form Styles
   ======================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label-icon {
    font-size: 1rem;
    line-height: 1;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.12);
}

.form-input:hover:not(:focus) {
    border-color: rgba(0, 0, 0, 0.2);
}

.form-input.error {
    border-color: #da1e28;
    box-shadow: 0 0 0 3px rgba(218, 30, 40, 0.1);
}

.form-input.success {
    border-color: #198038;
}

/* Input wrapper for password toggle */
.form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-wrapper .form-input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    font-size: 1rem;
    line-height: 1;
}

.toggle-password:hover {
    background: var(--bg-secondary);
}

.eye-icon {
    display: inline-block;
    line-height: 1;
}

/* ========================================
   Captcha
   ======================================== */
.captcha-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.captcha-input {
    flex: 1;
    letter-spacing: 2px;
    font-family: var(--font-mono);
}

.captcha-image-wrapper {
    position: relative;
    width: 140px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    transition: border-color var(--transition-fast);
    background: var(--bg-secondary);
}

.captcha-image-wrapper:hover {
    border-color: var(--brand-primary);
}

.captcha-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.captcha-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
}

.captcha-loading.hidden {
    display: none;
}

/* ========================================
   Checkbox & Agreement
   ======================================== */
.form-group-agreement {
    margin-top: var(--space-xs);
}

.form-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-strong);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-top: 1px;
}

.checkbox-custom::after {
    content: "✓";
    font-size: 12px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.form-checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.form-checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.form-checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.2);
}

.checkbox-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.link-privacy {
    color: var(--brand-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.link-privacy:hover {
    color: var(--brand-secondary);
    text-decoration: underline;
}

/* ========================================
   Submit Button
   ======================================== */
.btn-auth {
    width: 100%;
    padding: 14px 24px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: white;
    background: var(--brand-gradient);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    margin-top: var(--space-sm);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 98, 254, 0.35);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ========================================
   Form Messages
   ======================================== */
.form-error {
    text-align: center;
    padding: 10px 16px;
    background: rgba(218, 30, 40, 0.06);
    border: 1px solid rgba(218, 30, 40, 0.2);
    border-radius: var(--radius-md);
    color: #da1e28;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-success {
    text-align: center;
    padding: 10px 16px;
    background: rgba(25, 128, 56, 0.06);
    border: 1px solid rgba(25, 128, 56, 0.2);
    border-radius: var(--radius-md);
    color: #198038;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-hint {
    font-size: 0.8125rem;
    min-height: 0;
    transition: all var(--transition-fast);
}

.form-hint.error {
    color: #da1e28;
}

.form-hint.success {
    color: #198038;
}

/* ========================================
   Password Strength
   ======================================== */
.password-strength {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: 4px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.strength-fill.weak {
    width: 33%;
    background: #da1e28;
}

.strength-fill.medium {
    width: 66%;
    background: #f1c21b;
}

.strength-fill.strong {
    width: 100%;
    background: #198038;
}

.strength-text {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 36px;
}

.strength-text.weak {
    color: #da1e28;
}

.strength-text.medium {
    color: #f1c21b;
}

.strength-text.strong {
    color: #198038;
}

/* ========================================
   Auth Switch Link
   ======================================== */
.auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-switch a:hover {
    color: var(--brand-secondary);
    text-decoration: underline;
}

/* ========================================
   Modal (Privacy / Terms)
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: var(--space-lg);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg) var(--space-xl);
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
}

.modal-body h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: var(--space-md) 0 var(--space-xs);
    color: var(--text-primary);
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-sm);
}

.modal-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-modal {
    padding: 10px 24px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: var(--brand-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-modal:hover {
    background: var(--brand-secondary);
}

/* ========================================
   Toast Notification
   ======================================== */
.auth-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10001;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.auth-toast.success {
    background: #198038;
    color: white;
}

.auth-toast.error {
    background: #da1e28;
    color: white;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
    .auth-container {
        padding: 0 var(--space-md);
    }

    .auth-card {
        padding: var(--space-xl) var(--space-lg);
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .captcha-row {
        flex-direction: column;
    }

    .captcha-image-wrapper {
        width: 100%;
        height: 52px;
    }

    .captcha-input {
        letter-spacing: normal;
    }

    .modal-content {
        max-height: 90vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
}
