/*
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
*/

/* =============================================================================
   VARIABLES (Consider moving to a dedicated variables.css if extensive)
   ============================================================================= */

:root {
    --medium-blue: #4a89dc;
    --medium-light-blue: #6ca3e0;
    --medium-dark-blue: #3b7dd8;
    --medium-gray: #888;
    --medium-green: #03a87c;
    --font-serif: 'Merriweather', serif; /* Example serif font */
    --transition-base: 0.3s ease;
}

/* =============================================================================
   MAIN AUTHENTICATION PAGE LAYOUT
   ============================================================================= */

/* Main authentication container */
.auth-page-container {
    display: flex;
    max-width: 1200px;
    margin: 3rem auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 600px;
    background: white;
}

/* Left side - authentication form */
.auth-card {
    flex: 1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

/* Right side - illustration and benefits */
.auth-illustration {
    flex: 1;
    background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.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: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--medium-blue), var(--medium-light-blue));
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.2);
}

.auth-logo i {
    font-size: 2rem;
    color: white;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.7rem;
    color: var(--medium-dark-blue);
}

.auth-subtitle {
    color: var(--medium-gray);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Auth form styles */
.auth-content {
    flex-grow: 1;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
    font-weight: 500;
    color: var(--medium-dark-blue);
}

.form-group label i {
    margin-right: 0.6rem;
    color: var(--medium-blue);
    font-size: 1.1rem;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #f9fafc;
}

.form-control:focus {
    border-color: var(--medium-blue);
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Form validation styling */
.is-invalid {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1) !important;
}

.form-error {
    color: #e53935;
    font-size: 0.85rem;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.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(3, 168, 124, 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(255, 59, 48, 0.1);
    border-left: 4px solid #e53935;
    color: #e53935;
}

.alert-danger::before, .alert-error::before {
    content: "\f057"; /* fa-times-circle */
}

.alert-info {
    background-color: rgba(0, 102, 204, 0.1);
    border-left: 4px solid var(--medium-blue);
    color: var(--medium-blue);
}

.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: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--medium-gray);
    padding: 5px;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--medium-blue);
}

.toggle-password:focus {
    outline: none;
}

/* Auth button styles */
.auth-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem;
    background: linear-gradient(135deg, var(--medium-blue), var(--medium-light-blue));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.2);
    text-align: center;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, var(--medium-dark-blue), var(--medium-blue));
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
    color: black;
}

.auth-submit-btn:active {
    transform: translateY(-1px);
}

/* Social login button */
.social-auth-container {
    margin-top: 2rem;
}

.social-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--medium-gray);
    margin: 1.5rem 0;
}

.social-auth-divider::before,
.social-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 102, 204, 0.1);
}

.social-auth-divider span {
    padding: 0 10px;
}

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.9rem;
    background: white;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.btn-google:hover {
    background: #f8f8f8;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-google img {
    width: 18px;
    height: 18px;
}

/* Auth footer */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--medium-gray);
}

.auth-footer a {
    color: var(--medium-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-footer a:hover {
    color: var(--medium-dark-blue);
    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(--medium-blue);
    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;
}

/* Forgot password link */
.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
}

.forgot-password a {
    color: var(--medium-blue);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password a:hover {
    color: var(--medium-dark-blue);
    text-decoration: underline;
}

/* Benefits and features list */
.auth-benefits,
.auth-features {
    margin-top: 1rem;
    text-align: left;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.auth-benefits h3,
.auth-features h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--medium-dark-blue);
}

.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: 2rem;
    background: linear-gradient(135deg, var(--medium-blue) 0%, var(--medium-dark-blue) 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
    margin-right: 1.5rem;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-title h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.profile-title .subtitle {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.profile-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.danger-card {
    border: 2px solid #fee2e2;
}

.danger-card .card-header {
    background: #fef2f2;
    color: #dc2626;
}

.card-header {
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--medium-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.danger-card .card-icon {
    background: #dc2626;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.card-content {
    padding: 1.5rem;
}

.info-item {
    margin-bottom: 1rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.info-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    color: #6b7280;
}

.verification-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verification-badge.verified {
    background: #d1fae5;
    color: #065f46;
}

.verification-badge.unverified {
    background: #fee2e2;
    color: #991b1b;
}

.verification-action {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.security-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.security-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.danger-warning h4 {
    margin: 0 0 0.5rem 0;
    color: #dc2626;
    font-weight: 600;
}

.danger-warning p {
    margin: 0 0 1rem 0;
    color: #6b7280;
}

/* Enhanced button styles for profile */
.btn-outline-secondary {
    background: transparent;
    color: #6b7280;
    border: 2px solid #d1d5db;
}

.btn-outline-secondary:hover {
    background: #f9fafb;
    color: #374151;
}

.btn-outline-warning {
    background: transparent;
    color: #d97706;
    border: 2px solid #fbbf24;
}

.btn-outline-warning:hover {
    background: #fef3c7;
    color: #92400e;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc2626;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.confirmation-input {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.confirmation-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #991b1b;
}

.confirmation-input input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #fecaca;
    border-radius: 4px;
    font-family: monospace;
}

.confirmation-input input:focus {
    outline: none;
    border-color: #dc2626;
}

.modal-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Responsive Design for Auth Pages */
@media (max-width: 600px) {
    .auth-container {
        margin: 1rem; /* Reduce margin on smaller screens */
        padding: 1.5rem; /* Reduce padding */
        max-width: 100%; /* Allow container to take full width minus margins */
        box-shadow: none; /* Optional: remove shadow on very small screens for a flatter look */
        border-radius: 0; /* Optional: remove border-radius if it's edge-to-edge */
    }

    .auth-container h2 {
        font-size: 1.5rem; /* Adjust heading size */
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-control {
        padding: 0.65rem;
        font-size: 0.95rem;
    }

    .btn, .btn-primary, .btn-google {
        padding: 0.65rem 1.2rem;
        font-size: 0.95rem;
        width: 100%; /* Make buttons full-width for easier tapping */
        box-sizing: border-box; /* Ensure padding and border are included in the element's total width and height */
    }
    
    .btn-google {
        margin-bottom: 0.75rem; /* Adjust margin if needed when stacked */
    }

    .form-actions {
        margin: 1rem 0;
    }
    
    .form-actions .btn + .btn { /* If you have multiple buttons in form-actions */
        margin-top: auto;
    }

    .auth-links {
        font-size: 0.85rem;
    }

    .social-auth-container {
        margin: 1.5rem 0 0.5rem;
    }

    .social-auth-divider {
        margin: 1rem 0;
    }

    .social-auth-divider span {
        padding: 0 0.5rem; /* Reduce padding for the "or" text */
    }
}

@media (max-width: 400px) {
    .auth-container {
        padding: 1rem;
    }
    .auth-container h2 {
        font-size: 1.3rem;
    }
    .form-control, .btn, .btn-primary, .btn-google {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 992px) {
    .auth-page-container {
        flex-direction: column;
        margin: 1.5rem;
    }
    
    .auth-illustration {
        padding: 2rem;
        order: -1; /* Move illustration to the top on mobile */
    }
    
    .auth-img {
        max-width: 60%;
    }
}

@media (max-width: 768px) {
    .auth-page-container {
        margin: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-form {
        max-width: 100%;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .auth-page-container {
        margin: 0.5rem;
    }
    
    .auth-card {
        padding: 1rem;
    }
    
    .auth-illustration {
        padding: 1.5rem;
    }
    
    .form-control {
        padding: 0.8rem;
    }
    
    .auth-submit-btn {
        padding: 0.9rem;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
}

/* Profile page responsive adjustments */
@media (max-width: 992px) {
    .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) {
    .profile-container {
        padding: 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .profile-avatar {
        margin: 0 0 1rem 0;
    }
    
    .profile-title h1 {
        font-size: 1.8rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .profile-container {
        padding: 0.5rem;
    }
    
    .profile-header {
        padding: 1rem;
    }
    
    .avatar-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .profile-title h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}