/* style/login.css */

/* Variables and Base Styles (ensure they are scoped to .page-login) */
.page-login {
    --primary-color: #017439; /* Thabet green */
    --secondary-color: #FFFFFF; /* White */
    --button-bg-color: #017439; /* LOGIN button: Primary green for contrast (overriding custom red) */
    --button-text-color: #FFFFFF; /* LOGIN button: White text for contrast (overriding custom yellow) */
    --register-button-bg-color: #017439; /* REGISTER button: Primary green for contrast (overriding custom red) */
    --register-button-text-color: #FFFFFF; /* REGISTER button: White text for contrast (overriding custom yellow) */
    --background-color: #FFFFFF; /* Page background */
    --text-color: #333333; /* Dark grey for general text */
    --link-color: #017439; /* Primary color for links */

    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Fixed Header Spacing */
.page-login {
    padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
}

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

.page-login__section-title {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
}

.page-login__section-title--white {
    color: var(--secondary-color);
}

/* 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;
    background: linear-gradient(135deg, var(--primary-color) 0%, #309460 100%); /* Green gradient */
    color: var(--secondary-color);
    overflow: hidden; /* To contain the image if it's slightly off */
}

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

.page-login__hero-image {
    width: 100%;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.page-login__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-login__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 500px; /* Limit form width */
    background-color: rgba(255, 255, 255, 0.95); /* Semi-transparent white background for form */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: var(--text-color); /* Dark text on light background */
    margin-top: -80px; /* Overlap with image slightly */
}

.page-login__main-title {
    font-size: 38px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.page-login__intro-text {
    font-size: 18px;
    margin-bottom: 30px;
    color: #555555;
}

.page-login__form {
    width: 100%;
    margin-bottom: 20px;
}

.page-login__form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.page-login__form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.page-login__form-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(1, 116, 57, 0.2);
}

.page-login__form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.page-login__btn-login {
    display: inline-block;
    padding: 14px 30px;
    background: var(--button-bg-color); /* Primary green */
    color: var(--button-text-color); /* White text */
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-grow: 1;
    margin-right: 15px;
}

.page-login__btn-login:hover {
    background: #005a2d; /* Darker green */
    transform: translateY(-2px);
}

.page-login__link-forgot-password {
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

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

.page-login__register-prompt {
    margin-top: 30px;
    font-size: 16px;
    color: #555555;
}

.page-login__register-prompt p {
    margin-bottom: 10px;
}

.page-login__btn-register {
    display: inline-block;
    padding: 12px 25px;
    background: var(--register-button-bg-color); /* Primary green for contrast */
    color: var(--register-button-text-color); /* White text for contrast */
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.page-login__btn-register:hover {
    background: #005a2d; /* Darker green */
    transform: translateY(-2px);
}

/* Security Section */
.page-login__security-section {
    padding: 80px 0;
    background-color: var(--background-color); /* White background */
    color: var(--text-color);
}

.page-login__security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: center;
}

.page-login__security-item {
    background: var(--secondary-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.page-login__security-item:hover {
    transform: translateY(-5px);
}

.page-login__security-item img {
    width: 100%;
    height: auto;
    max-width: 400px; /* Example max width */
    margin-bottom: 20px;
    border-radius: 5px;
    object-fit: cover;
}

.page-login__security-item-title {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* FAQ Section */
.page-login__faq-section {
    padding: 80px 0;
    background: var(--primary-color); /* Primary green background */
    color: var(--secondary-color); /* White text */
}

.page-login__faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.page-login__faq-item {
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
}

.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;
    padding: 0 15px;
    opacity: 0;
}

.page-login__faq-item.active .page-login__faq-answer {
    max-height: 2000px !important;
    padding: 20px 15px !important;
    opacity: 1;
    background: rgba(255, 255, 255, 0.9); /* Light background for answer */
    border-radius: 0 0 5px 5px;
    color: var(--text-color); /* Dark text on light background */
}

.page-login__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--secondary-color); /* White background for question */
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    color: var(--text-color); /* Dark text on light background */
}

.page-login__faq-question:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.page-login__faq-question:active {
    background: #eeeeee;
}

.page-login__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none;
}

.page-login__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: var(--primary-color); /* Primary green for toggle icon */
    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: 28px;
    height: 28px;
}

.page-login__faq-item.active .page-login__faq-toggle {
    color: #333;
    transform: rotate(45deg); /* Rotate for 'x' effect */
}


/* CTA Section */
.page-login__cta-section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--background-color);
    color: var(--text-color);
}

.page-login__cta-container {
    max-width: 800px;
}

.page-login__cta-section p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #555555;
}

.page-login__btn-register--large {
    padding: 18px 40px;
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-login__main-title {
        font-size: 32px;
    }
    .page-login__section-title {
        font-size: 28px;
    }
    .page-login__security-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-login {
        padding-top: var(--header-offset, 120px) !important; /* Mobile specific header offset */
        font-size: 16px;
        line-height: 1.6;
    }

    .page-login__hero-section {
        padding: 40px 15px;
    }

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

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

    .page-login__hero-content {
        padding: 20px;
        margin-top: -60px; /* Adjust overlap for mobile */
    }

    .page-login__main-title {
        font-size: 26px;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .page-login__intro-text {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .page-login__form-actions {
        flex-direction: column;
        gap: 15px;
    }

    .page-login__btn-login,
    .page-login__btn-register,
    .page-login__btn-register--large {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px;
        padding-right: 15px;
        margin-right: 0 !important; /* Remove margin from login button */
    }

    .page-login__link-forgot-password {
        margin-top: 5px;
    }

    .page-login__security-section,
    .page-login__faq-section,
    .page-login__cta-section {
        padding: 40px 0;
    }

    .page-login__container {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .page-login__security-item img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-login__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .page-login__faq-question h3 {
        font-size: 15px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    
    .page-login__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    
    .page-login__faq-answer {
        padding: 0 15px;
    }
    
    .page-login__faq-item.active .page-login__faq-answer {
        padding: 15px !important;
    }
}