/**
 * Auth Modal Styles
 * 登录注册弹窗样式
 *
 * @package Toy
 * @since 1.0.0
 */

/* ========================================================================== 
   Header Auth Buttons
   ========================================================================== */

.header-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.header-auth .login-btn,
.header-auth .register-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-auth .login-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.header-auth .register-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.header-auth .register-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.header-auth .auth-separator {
    color: var(--text-light);
    margin: 0 0.25rem;
}

.header-auth .user-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-auth .user-account-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.header-auth .fa {
    font-size: 14px;
}

/* ========================================================================== 
   Modal Overlay
   ========================================================================== */

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* ========================================================================== 
   Modal Container
   ========================================================================== */

.auth-modal {
    position: relative;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.auth-modal.active {
    display: block;
    transform: scale(1) translateY(0);
    animation: modalSlideIn 0.3s ease;
}

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

.auth-modal-content {
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
}

/* ========================================================================== 
   Modal Header
   ========================================================================== */

.auth-modal-header {
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.auth-modal-logo {
    max-width: 150px;
    max-height: 60px;
    width: auto;
    height: auto;
    margin: 0 auto 1rem;
    display: block;
    /* 显示LOGO原色，不应用白色滤镜 */
}

.auth-modal-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    color: #fff;
}

.auth-modal-subtitle {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ========================================================================== 
   Modal Body
   ========================================================================== */

.auth-modal-body {
    padding: 2rem;
}

/* ========================================================================== 
   Form Styles
   ========================================================================== */

.auth-form {
    width: 100%;
}

.auth-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
}

.auth-form-group label .fa {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.auth-form-group input[type="text"],
.auth-form-group input[type="email"],
.auth-form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 255, 107, 53), 0.1);
}

/* 输入框验证状态 */
.auth-form-group.field-success input,
.auth-form-group input.input-success {
    border-color: #28a745;
}

.auth-form-group.field-success input:focus,
.auth-form-group input.input-success:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.auth-form-group.field-error input,
.auth-form-group input.input-error {
    border-color: #dc3545;
}

.auth-form-group.field-error input:focus,
.auth-form-group input.input-error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.auth-form-group.field-checking input,
.auth-form-group input.input-checking {
    border-color: #17a2b8;
}

.auth-form-group.field-checking input:focus,
.auth-form-group input.input-checking:focus {
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.auth-form-group.field-warning input,
.auth-form-group input.input-warning {
    border-color: #ffc107;
}

.auth-form-group.field-warning input:focus,
.auth-form-group input.input-warning:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.auth-form-group .password-toggle {
    position: absolute;
    right: 1rem;
    top: 2.2rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

.auth-form-group .password-toggle:hover {
    color: var(--primary-color);
}

.auth-form-group .password-toggle.active {
    color: var(--primary-color);
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
    transition: all 0.3s ease;
    line-height: 1.4;
}

/* Hint状态样式 */
.hint-success {
    color: #28a745 !important;
    font-weight: 500;
}

.hint-error {
    color: #dc3545 !important;
    font-weight: 500;
}

.hint-checking {
    color: #17a2b8 !important;
    font-weight: 500;
}

.hint-warning {
    color: #ffc107 !important;
    font-weight: 500;
}

.hint-info {
    color: #6c757d;
    font-size: 0.7rem;
}

/* Password Rules List */
.password-rules {
    list-style: none;
    padding: 0.75rem;
    margin: 0.5rem 0 0 0;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.password-rules li {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.password-rules li i {
    width: 20px;
    display: inline-block;
    margin-right: 0.5rem;
}

.password-rules .rule-valid {
    color: #28a745;
    font-weight: 500;
}

.password-rules .rule-invalid {
    color: #adb5bd;
}

.password-rules .password-strength {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
    font-weight: 600;
}

.password-rules .strength-weak {
    color: #dc3545;
}

.password-rules .strength-medium {
    color: #ffc107;
}

.password-rules .strength-strong {
    color: #28a745;
}

/* ========================================================================== 
   Form Row (Remember Me, Forgot Password)
   ========================================================================== */

.auth-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    margin: 0;
}

.auth-checkbox input[type="checkbox"] {
    margin: 0 0.5rem 0 0;
    cursor: pointer;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

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

/* ========================================================================== 
   Submit Button
   ========================================================================== */

.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-submit-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

.auth-submit-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* ========================================================================== 
   Messages
   ========================================================================== */

.auth-message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: none;
}

.auth-message.show {
    display: block;
    animation: messageSlideIn 0.3s ease;
}

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

.auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========================================================================== 
   Modal Footer
   ========================================================================== */

.auth-modal-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-modal-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ========================================================================== 
   Close Button
   ========================================================================== */

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========================================================================== 
   Responsive Design
   ========================================================================== */

@media (max-width: 767px) {
    .auth-modal {
        width: 95%;
        max-width: 100%;
        margin: 1rem;
    }

    .auth-modal-header {
        padding: 1.5rem 1rem 1rem;
    }

    .auth-modal-body {
        padding: 1.5rem;
    }

    .auth-modal-logo {
        max-width: 120px;
        max-height: 50px;
    }

    .header-auth .login-btn span,
    .header-auth .register-btn span {
        display: none;
    }

    .header-auth .login-btn,
    .header-auth .register-btn {
        padding: 0.5rem 0.75rem;
        min-width: 40px;
    }

    .header-auth .auth-separator {
        margin: 0 0.15rem;
    }

    .auth-form-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .auth-modal-header h2 {
        font-size: 1.5rem;
    }

    .auth-form-group input {
        padding: 0.65rem 0.875rem;
        font-size: 0.875rem;
    }

    .auth-submit-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* ========================================================================== 
   Print Styles
   ========================================================================== */

@media print {
    .auth-modal-overlay {
        display: none !important;
    }
}

/* ========================================================================== 
   Accessibility
   ========================================================================== */

.auth-form-group input:focus,
.auth-submit-btn:focus,
.auth-modal-close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-modal {
        border: 2px solid currentColor;
    }
    
    .auth-submit-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-modal-overlay,
    .auth-modal,
    .auth-submit-btn,
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================================================== 
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .auth-modal {
        background: #1a1a1a;
        color: #fff;
    }

    .auth-form-group input {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }

    .auth-modal-footer {
        border-top-color: #444;
    }
}

