/* style/login.css */

:root {
    --primary-color: #0A192F;
    --secondary-color: #FFD700;
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-dark: #1a1a1a; /* From body background in shared.css */
    --form-bg: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.2);
}

.page-login {
    font-family: 'Arial', sans-serif;
    color: var(--text-light); /* Main text color for dark body background */
    background-color: var(--bg-dark);
}

.page-login__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-login__text-center {
    text-align: center;
}

/* Hero Section */
.page-login__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
    background: linear-gradient(135deg, var(--primary-color), #000000);
    overflow: hidden;
}

.page-login__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.page-login__hero-image {
    width: 100%;
    margin-bottom: 30px;
    max-height: 500px;
    overflow: hidden;
    border-radius: 12px;
}

.page-login__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 12px;
}

.page-login__hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    width: 100%;
    max-width: 500px; /* Limit form width */
    background: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.page-login__main-title {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.page-login__description {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

.page-login__login-form-wrapper {
    margin-top: 30px;
}

.page-login__login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-login__form-group {
    text-align: left;
}

.page-login__form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-light);
}

.page-login__form-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--form-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1em;
    box-sizing: border-box;
}

.page-login__form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.page-login__form-input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

.page-login__form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.page-login__cta-button, .page-login__register-button, .page-login__register-now-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-login__btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
}

.page-login__btn-primary:hover {
    background: #e6c200;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.page-login__link-forgot-password {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.page-login__link-forgot-password:hover {
    color: #e6c200;
    text-decoration: underline;
}

.page-login__register-prompt {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.page-login__register-prompt p {
    margin-bottom: 15px;
    font-size: 1em;
    color: var(--text-light);
}

.page-login__btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.page-login__btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* General Sections */
.page-login__section {
    padding: 80px 0;
    background-color: var(--bg-dark);
}

.page-login__dark-bg {
    background-color: var(--primary-color);
}

.page-login__section-title {
    font-size: 2.2em;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.page-login__section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.page-login__section-intro {
    font-size: 1.05em;
    color: var(--text-light);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
    line-height: 1.7;
}

/* Why Login Section */
.page-login__why-login {
    background-color: #1f1f1f;
}

.page-login__feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-login__feature-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-login__feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.page-login__feature-item img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px solid var(--secondary-color);
}

.page-login__feature-title {
    font-size: 1.4em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.page-login__feature-description {
    font-size: 0.95em;
    color: var(--text-light);
    line-height: 1.6;
}

/* Security Section */
.page-login__security {
    background-color: var(--primary-color);
}

.page-login__security-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-login__security-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.page-login__security-item img {
    width: 100%;
    
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
    filter: brightness(1.1); /* Slight brightness adjustment for visibility, no color change */
}

.page-login__security-title {
    font-size: 1.3em;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.page-login__security-description {
    font-size: 0.9em;
    color: var(--text-light);
    line-height: 1.6;
}

/* Troubleshooting Section */
.page-login__troubleshooting {
    background-color: #1f1f1f;
}

.page-login__troubleshooting-list {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-login__troubleshooting-list li {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-light);
    border-left: 4px solid var(--secondary-color);
}

.page-login__troubleshooting-list li strong {
    color: var(--secondary-color);
}

.page-login__support-text {
    text-align: center;
    margin-top: 40px;
    font-size: 1.1em;
    color: var(--text-light);
}

.page-login__support-text a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.page-login__support-text a:hover {
    text-decoration: underline;
    color: #e6c200;
}

/* Register CTA Section */
.page-login__register-cta {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color), #000000);
}

.page-login__register-now-button {
    margin-top: 30px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    max-width: 350px;
}

.page-login__register-now-button:hover {
    background: #e6c200;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

/* FAQ Section */
.page-login__faq {
    background-color: #1f1f1f;
}

.page-login__faq-list {
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* FAQ容器样式 */
.page-login__faq-item {
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* FAQ默认状态 - 答案隐藏 */
.page-login__faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
    padding: 0 25px;
    opacity: 0;
    color: var(--text-light);
    font-size: 0.95em;
    line-height: 1.6;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-login__faq-item.active .page-login__faq-answer {
    max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
    padding: 20px 25px !important;
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 10px 10px;
}

/* 问题样式 */
.page-login__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.page-login__faq-question:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary-color);
}

.page-login__faq-question:active {
    background: rgba(255, 255, 255, 0.2);
}

/* 问题标题样式 */
.page-login__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--secondary-color);
    pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.page-login__faq-toggle {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    color: var(--secondary-color);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
    pointer-events: none; /* 防止图标阻止点击事件 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.page-login__faq-item.active .page-login__faq-toggle {
    transform: rotate(45deg); /* Rotate for 'x' effect, or use '-' */
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-login {
        font-size: 16px;
        line-height: 1.6;
    }

    .page-login__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-login__main-title {
        font-size: 2em;
    }

    .page-login__description {
        font-size: 1em;
    }

    .page-login__hero-image {
        margin-bottom: 20px;
        border-radius: 8px;
    }

    .page-login__hero-image img {
        border-radius: 8px;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-login__hero-content {
        padding: 20px;
        border-radius: 8px;
    }

    .page-login__cta-button, .page-login__register-button, .page-login__register-now-button {
        padding: 12px 25px;
        font-size: 1em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-login__form-actions, .page-login__register-prompt {
        padding-left: 0;
        padding-right: 0;
    }

    .page-login__section {
        padding: 50px 0;
    }

    .page-login__section-title {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .page-login__section-intro {
        font-size: 0.95em;
        margin-bottom: 30px;
    }

    .page-login__feature-grid, .page-login__security-features {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .page-login__feature-item, .page-login__security-item {
        padding: 25px;
        border-radius: 10px;
    }

    .page-login__feature-item img, .page-login__security-item img {
        
    }

    .page-login__feature-title, .page-login__security-title {
        font-size: 1.2em;
    }

    .page-login__troubleshooting-list {
        padding: 0 15px;
    }

    .page-login__troubleshooting-list li {
        padding: 15px;
        font-size: 0.95em;
    }

    .page-login__support-text {
        font-size: 1em;
    }

    .page-login__register-cta {
        padding: 60px 0;
    }

    .page-login__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }

    .page-login__faq-question h3 {
        font-size: 1em;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }

    .page-login__faq-toggle {
        margin-left: 10px;
        width: 28px;
        height: 28px;
        font-size: 24px;
    }

    .page-login__faq-answer {
        padding: 0 15px;
    }

    .page-login__faq-item.active .page-login__faq-answer {
        padding: 15px !important;
    }

    .page-login img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-login__section,
    .page-login__card,
    .page-login__container,
    .page-login__feature-item,
    .page-login__security-item,
    .page-login__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}