/*
Authentication Styles

This stylesheet contains styles for all authentication-related pages,
including login, registration, password reset, and profile management.

Key features:
- Responsive design for various screen sizes.
- Consistent styling for forms, buttons, and alerts.
- Accessibility enhancements for focus states and ARIA attributes.

Dependencies:
- Font Awesome for icons.
- Custom properties (variables) defined in this file or a global variables file.

Browser Support:
- Modern browsers (Chrome, Firefox, Safari, Edge)

Last Updated: June 8, 2025
Author: HowToolHelp/Intelligent
*/

/* =============================================================================
   MAIN AUTHENTICATION PAGE LAYOUT
   ============================================================================= */

/* Main authentication container */
.auth-page-container {
    display: flex;
    max-width: 1000px;
    margin: 4rem auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    min-height: 600px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Left side - authentication form */
.auth-card {
    flex: 1.2;
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* Right side - illustration and benefits */
.auth-illustration {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.auth-img {
    max-width: 80%;
    height: auto;
    margin-bottom: 2rem;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Auth header styles */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 168, 204, 0.3);
    transform: rotate(-5deg);
}

.auth-logo i {
    font-size: 2.5rem;
    color: white;
}

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.7rem;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--medium-gray);
    font-size: 1.1rem;
    margin-bottom: 0;
    font-weight: 500;
}

/* Auth form styles */
.auth-content {
    flex-grow: 1;
}

.auth-form {
    max-width: 420px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 0.7rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    border: 2px solid #eee;
    border-radius: 12px;
    transition: var(--transition);
    background-color: #fdfdfd;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 168, 204, 0.1);
}

/* Form validation styling */
.is-invalid {
    border-color: var(--error-red) !important;
    box-shadow: 0 0 0 4px rgba(214, 48, 49, 0.1) !important;
}

.form-error {
    color: var(--error-red);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.form-error::before {
    content: "!";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #e53935;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #4a89dc;
    color: white;
    font-family: var(--font-serif); /* 新增：明確指定字體系列 */
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #4a89dc;
}

.btn-primary:hover {
    background-color: #3b7dd8;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #4a89dc;
    color: white;
    font-family: var(--font-serif); /* 新增：明確指定字體系列 */
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #4a89dc;
}

.btn-primary:hover {
    background-color: #3b7dd8;
}

.form-actions {
    text-align: center;
    margin: 1.5rem 0;
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-links a {
    color: #4a89dc;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.5s ease;
}

.alert::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1.3rem;
}

.alert-success {
    background-color: rgba(0, 184, 148, 0.1);
    border-left: 4px solid var(--medium-green);
    color: var(--medium-green);
}

.alert-success::before {
    content: "\f058"; /* fa-check-circle */
}

.alert-danger, .alert-error {
    background-color: rgba(214, 48, 49, 0.1);
    border-left: 4px solid var(--error-red);
    color: var(--error-red);
}

.alert-danger::before, .alert-error::before {
    content: "\f057"; /* fa-times-circle */
}

.alert-info {
    background-color: rgba(0, 168, 204, 0.1);
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
}

.alert-info::before {
    content: "\f05a"; /* fa-info-circle */
}

.alert-warning {
    background-color: rgba(255, 149, 0, 0.1);
    border-left: 4px solid #ff9500;
    color: #ff9500;
}

.alert-warning::before {
    content: "\f071"; /* fa-exclamation-triangle */
}

/* Password input container for toggle visibility */
.password-input-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--medium-gray);
    padding: 5px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary-color);
}

.toggle-password:focus {
    outline: none;
}

/* Auth button styles */
.auth-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 168, 204, 0.3);
    text-align: center;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 168, 204, 0.4);
    color: white;
}

.auth-submit-btn:active {
    transform: translateY(-1px);
}

/* Social login button */
.social-auth-container {
    margin-top: 2.5rem;
}

.social-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--medium-gray);
    margin: 2rem 0;
    font-weight: 500;
}

.social-auth-divider::before,
.social-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #eee;
}

.social-auth-divider span {
    padding: 0 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    background: white;
    color: #3c4043;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .218s, border-color .218s, box-shadow .218s;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15);
    text-align: center;
}

.btn-google:hover {
    background-color: #f8f9fa;
    border-color: #d2d4d7;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15);
    transform: none;
}

.btn-google:active {
    background-color: #eeeeee;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30);
}

.btn-google img {
    width: 18px;
    height: 18px;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3c4043;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-error-container {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    font-size: 0.9rem;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
    height: 20px;
}

/* Auth footer */
.auth-footer {
    margin-top: 2.5rem;
    text-align: center;
    color: var(--medium-gray);
    font-weight: 500;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    margin-left: 5px;
}

.auth-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Password requirements */
.password-requirements {
    display: block;
    margin-top: 0.5rem;
    color: var(--medium-gray);
    font-size: 0.85rem;
}

.password-requirements i {
    color: var(--primary-color);
    margin-right: 5px;
}

/* Password match indicator */
.password-match-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #e53935;
}

.password-match-indicator.match {
    color: var(--medium-green);
}

.match-icon {
    display: inline-block;
}

.password-match-indicator.match .match-icon i {
    color: var(--medium-green);
}

.password-match-indicator.match .match-text {
    color: var(--medium-green);
}

.password-match-indicator .fa-check-circle {
    display: none;
}

.password-match-indicator.match .fa-check-circle {
    display: inline-block;
}

.password-match-indicator.match .fa-times-circle {
    display: none;
}

/* =============================================================================
   MOBILE RESPONSIVE OVERRIDES
   ============================================================================= */

@media (max-width: 992px) {
    .auth-page-container {
        max-width: 90%;
        margin: 2rem auto;
    }
    
    .auth-card {
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    .auth-page-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .auth-illustration {
        padding: 2.5rem;
        order: -1; /* Show illustration on top for mobile */
    }
    
    .auth-img {
        max-width: 60%;
        margin-bottom: 1.5rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .auth-page-container {
        margin: 1rem auto;
        border-radius: 15px;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-form {
        max-width: 100%;
    }
    
    .auth-submit-btn {
        padding: 0.9rem;
    }
}

/* Forgot password link */
.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
}

.forgot-password a {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Benefits and features list */
.auth-benefits,
.auth-features {
    margin-top: 1rem;
    text-align: left;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    color: var(--dark-text);
}

.auth-benefits h3,
.auth-features h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.auth-benefits ul,
.auth-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-benefits li,
.auth-features li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-benefits li i,
.auth-features li i {
    color: var(--medium-green);
    font-size: 1.1rem;
}

/* Enhanced Profile Page Styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    color: var(--secondary-color);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-avatar {
    margin-right: 2rem;
}

.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 168, 204, 0.3);
}

.profile-title h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.profile-title .subtitle {
    margin: 0.5rem 0 0 0;
    color: var(--medium-gray);
    font-size: 1.1rem;
    font-weight: 500;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.profile-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.danger-card {
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.danger-card .card-header {
    background: rgba(254, 242, 242, 0.8);
    color: #dc2626;
}

.card-header {
    padding: 1.5rem 2rem;
    background: rgba(248, 250, 252, 0.5);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    align-items: center;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.2rem;
    font-size: 1.2rem;
}

.danger-card .card-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.card-content {
    padding: 2rem;
}

.info-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
}

.info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-item label,
.info-item .info-label {
    display: block;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.info-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.1rem;
    color: var(--dark-text);
}

.verification-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.verification-badge.verified {
    background: rgba(0, 184, 148, 0.1);
    color: #00b894;
}

.verification-badge.unverified {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.verification-action {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.security-info h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.security-info p {
    margin: 0;
    color: var(--medium-gray);
    font-size: 0.95rem;
}

.danger-warning h4 {
    margin: 0 0 0.7rem 0;
    color: #dc2626;
    font-weight: 700;
    font-size: 1.1rem;
}

.danger-warning p {
    margin: 0 0 1.5rem 0;
    color: var(--medium-gray);
    line-height: 1.6;
}

/* Enhanced button styles for profile */
.btn-outline-secondary {
    background: transparent;
    color: var(--medium-gray);
    border: 2px solid #e2e8f0;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-warning {
    background: transparent;
    color: #d97706;
    border: 2px solid #fcd34d;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-warning:hover {
    background: #fffbeb;
    color: #92400e;
    border-color: #d97706;
}

/* Modal Styles - Only for custom modals without fade class */
.modal:not(.fade) {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal:not(.fade).show {
    display: flex;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #dc2626;
    font-weight: 800;
}

.modal-body {
    padding: 2rem;
}

.modal-body ul {
    margin: 1.2rem 0;
    padding-left: 1.5rem;
    color: var(--dark-text);
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.confirmation-input {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(254, 242, 242, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(254, 202, 202, 0.5);
}

.confirmation-input label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: #991b1b;
}

.confirmation-input input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid rgba(254, 202, 202, 0.8);
    border-radius: 10px;
    font-family: monospace;
    background: white;
    transition: var(--transition);
}

.confirmation-input input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.modal-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* =============================================================================
   MOBILE RESPONSIVE OVERRIDES
   ============================================================================= */

@media (max-width: 992px) {
    .auth-page-container {
        flex-direction: column;
        margin: 1.5rem;
        min-height: auto;
    }
    
    .auth-illustration {
        padding: 3rem 2rem;
        order: -1;
    }
    
    .auth-img {
        max-width: 250px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .security-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .info-value {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .auth-illustration {
        display: none;
    }

    .auth-card {
        padding: 2.5rem 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
    }

    .profile-container {
        padding: 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
    }
    
    .profile-avatar {
        margin: 0 0 1.5rem 0;
    }
    
    .profile-title h1 {
        font-size: 1.8rem;
    }
    
    .card-content {
        padding: 1.5rem;
    }
    
    .card-header {
        padding: 1.2rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .auth-page-container {
        margin: 0;
        border-radius: 0;
    }
    
    .auth-card {
        padding: 2rem 1rem;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
    }
    
    .auth-logo i {
        font-size: 1.8rem;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
    }

    .auth-submit-btn {
        padding: 1.2rem; /* Increased for better touch targets */
        font-size: 1rem;
    }

    .form-control {
        padding: 1.1rem 1.2rem; /* Slightly larger for mobile */
        font-size: 1rem;
    }

    .profile-container {
        padding: 0.5rem;
    }
    
    .profile-header {
        padding: 1.5rem 1rem;
        border-radius: 0;
    }
    
    .avatar-circle {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .profile-title h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        border-radius: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
        padding: 0.9rem; /* Ensure buttons are touch-friendly */
    }
}
    
    .modal-actions {
        flex-direction: column;
    }
}