/**
 * Hope Mission Login Page Styles
 * Fonts: Poppins (Headings), Century Gothic (Body)
 * Accent Color: #f36f28
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.hope-mission-login-page {
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    color: #4a5568;
}

/* Login Container */
.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Login Wrapper */
.login-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    max-width: 450px;
    width: 100%;
    padding: 48px;
    position: relative;
    z-index: 2;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Header */
.login-header,
.hope-mission-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    margin-bottom: 24px;
}

.logo-container img {
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.site-title {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.login-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.login-subtitle {
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

/* Form Styles */
.login-form-container {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 8px;
}

.input-icon {
    color: #f36f28;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    font-size: 16px;
    color: #2d3748;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    background: #ffffff;
    border-color: #f36f28;
    box-shadow: 0 0 0 3px rgba(243, 111, 40, 0.15);
}

.form-input::placeholder {
    color: #a0aec0;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #f36f28;
}

.checkbox-label {
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    font-size: 14px;
    color: #4a5568;
}

.forgot-password {
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    font-size: 14px;
    color: #f36f28;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #d65615;
    /* Darkened accent */
    text-decoration: underline;
}

/* Form Message */
.form-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-message.error {
    background: #fff5f5;
    color: #c53030;
    border-left: 4px solid #c53030;
}

.form-message.success {
    background: #f0fff4;
    color: #276749;
    border-left: 4px solid #276749;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 14px 20px;
    font-family: 'Poppins', sans-serif;
    /* Buttons often look better with the heading font */
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #f36f28;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(243, 111, 40, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-button:hover {
    background: #d65615;
    transform: translateY(-1px);
    box-shadow: 0 6px 10px rgba(243, 111, 40, 0.25);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-loader .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Login Tabs */
.login-tabs {
    display: flex;
    gap: 20px;
    /* More spacing */
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    padding: 10px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #718096;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -1px;
    /* Align with border-bottom */
}

.tab-button:hover {
    color: #f36f28;
}

.tab-button.active {
    color: #f36f28;
    border-bottom-color: #f36f28;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease;
}

/* Magic Link & Microsoft Info */
.magic-link-info,
.microsoft-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #eff6ff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-icon {
    flex-shrink: 0;
    color: #3b82f6;
    margin-top: 2px;
}

.magic-link-info p,
.microsoft-info p {
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    font-size: 14px;
    color: #1e3a8a;
    margin: 0;
    line-height: 1.5;
}

/* Microsoft Button */
.microsoft-button {
    width: 100%;
    padding: 12px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #2d3748;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.microsoft-button:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.microsoft-button:active {
    transform: translateY(0);
}

.microsoft-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.microsoft-icon {
    flex-shrink: 0;
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #edf2f7;
    margin-top: 20px;
}

.footer-text {
    font-family: 'Century Gothic', 'Tw Cen MT', Futura, sans-serif;
    font-size: 12px;
    color: #a0aec0;
    margin: 0;
}

/* Background Elements */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* Allow clicks to pass through if needed, though usually nothing behind */
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    /* Solid background is on body */
}

/* Subtle accent shapes in background */
.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(243, 111, 40, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(243, 111, 40, 0.05) 0%, transparent 40%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 30px;
        max-width: 400px;
    }

    .login-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0;
        /* Full screen on mobile */
        align-items: flex-start;
        /* Top align on mobile */
    }

    .login-wrapper {
        padding: 40px 24px;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        border-top: none;
        /* Often remove border on mobile anyway, but keeping intent clear */
    }

    .login-header {
        margin-bottom: 30px;
    }
}

/* Accessibility */
.form-input:focus-visible,
.login-button:focus-visible,
.forgot-password:focus-visible {
    outline: 2px solid #f36f28;
    outline-offset: 2px;
}

/* High Contrast & Reduced Motion */
@media (prefers-contrast: high) {
    .login-wrapper {
        border: 2px solid #000;
        box-shadow: none;
    }

    .form-input {
        border: 2px solid #000;
    }

    .login-button {
        border: 2px solid #000;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* LOGGED IN STATE OVERRIDES */
.login-wrapper.logged-in-view {
    border-top: none;
}

.hope-mission-already-logged-in {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hope-mission-already-logged-in .logo-container {
    margin-bottom: 24px;
}

.hope-mission-already-logged-in .logo-container img {
    max-width: 200px;
    height: auto;
}