/* ============================================
   MetaFlight SSO - Layout Styles (Global)
   ============================================ */

/* 1. Full-screen background with image */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: url('/images/mf-sso-bg.jpeg') no-repeat center center fixed !important;
    background-size: cover !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 2. Dark overlay to improve text readability */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* 3. Main SSO container - centers content vertically and horizontally */
.sso-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 20px;
}

/* 4. Common card styling with gradient background */
.sso-card {
    background-image: linear-gradient(191deg, #0a1729e6, #130f18e6), linear-gradient(to right, #0b2641, #25568f, #0b2641);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    width: 100%;
    padding: 32px 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 5. Brand/Title section */
.brand-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-align: center;
}

.brand-subtitle {
    font-size: 16px;
    color: #CDD9E5; /* subText */
    margin-bottom: 32px;
    text-align: center;
}

/* 6. Form controls - consistent styling */
.form-control {
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control:focus {
    border-color: #269EF5; /* metaCyan */
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(38, 158, 245, 0.2);
    color: #ffffff;
}

/* Input groups with icons */
.input-group-text {
    background: rgba(255, 255, 255, 0.1);
    border-right: none;
    border-radius: 8px 0 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #CDD9E5; /* subText */
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: #269EF5; /* metaCyan */
    background: rgba(255, 255, 255, 0.15);
}

/* 7. Primary button - MetaFlight gradient style (from React app) */
.btn-primary {
    position: relative;
    background-image: linear-gradient(250deg, #01CCFF, #497AC5), linear-gradient(to right, #0B2641, #25568F, #0B2641);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 14px;
    color: #061936;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
}

.btn-primary:hover {
    background-image: linear-gradient(250deg, #01CCFF, #497AC5), linear-gradient(to bottom, #01CBFE, #BE59EA);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.3);
    color: #061936;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
    background-image: linear-gradient(250deg, #01CCFF, #497AC5), linear-gradient(to bottom, #01CBFE, #BE59EA);
}

.btn-primary:focus {
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(1, 204, 255, 0.3);
    color: #061936;
}

.btn-primary:disabled {
    background-image: linear-gradient(250deg, #736e91, #395176), linear-gradient(to right, #0B2641, #25568F, #0B2641);
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Large button variant */
.btn-lg.btn-primary {
    padding: 10px 18px;
    font-size: 15px;
}

/* 8. Secondary/Outline button - MetaFlight style */
.btn-outline-secondary {
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-image: linear-gradient(#0D151E, #0D151E), linear-gradient(to bottom, #0D151E, #273B50);
    color: #CDD9E5;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-image: linear-gradient(#0D151E, #0D151E), linear-gradient(to bottom, #01CBFE, #BE59EA);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.3);
}

.btn-outline-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
}

/* Large secondary button variant */
.btn-lg.btn-outline-secondary {
    padding: 10px 18px;
    font-size: 15px;
}

/* Warning/Danger button for logout - MetaFlight warning gradient */
.btn-danger {
    background-image: linear-gradient(#0D151E, #0D151E), linear-gradient(to right, #FD6829, #C8331FD6);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 14px;
    color: #FCEFEB;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-image: linear-gradient(#FCEFEB, #FCEFEB), linear-gradient(to right, #E55726, #E55726);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.3);
    color: #E55726;
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
}

/* Large danger button variant */
.btn-lg.btn-danger {
    padding: 10px 18px;
    font-size: 15px;
}

/* 9. Alert styling */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-danger {
    background-color: #fee;
    color: #c00;
}

.alert-warning {
    background-color: #fffbea;
    color: #8b6914;
}

.alert-info {
    background-color: rgba(13, 110, 253, 0.1);
    color: #084298;
}

/* 10. Links */
a {
    color: #25A0F6; /* primary */
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #269EF5; /* metaCyan */
    text-decoration: underline;
}

/* 11. Section headers */
.section-header {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
}

/* 12. Footer links section */
.footer-links {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* 13. Page-specific card sizes */
.login-card {
    max-width: 400px;
}

.register-card {
    max-width: 600px;
}

/* Register form grid - 2 columns layout */
.register-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.consent-card {
    max-width: 580px;
}

/* 14. Consent page - scope list */
.scope-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 24px;
}

.scope-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    color: #ffffff;
}

.scope-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #269EF5; /* metaCyan */
}

.scope-item .form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.scope-item .form-check-input:checked {
    background-color: #269EF5; /* metaCyan */
    border-color: #269EF5;
}

/* Checkbox styling for dark theme */
.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.form-check-input:checked {
    background-color: #269EF5; /* metaCyan */
    border-color: #269EF5;
}

.form-check-input:focus {
    border-color: #269EF5;
    box-shadow: 0 0 0 3px rgba(38, 158, 245, 0.2);
}

.scope-item .form-check-label {
    cursor: pointer;
    flex: 1;
    margin-left: 12px;
}

/* Custom scrollbar for scope list */
.scope-list::-webkit-scrollbar {
    width: 8px;
}

.scope-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.scope-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.scope-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 15. Responsive design for mobile devices */
@@media (max-width: 576px) {
    .sso-card {
        padding: 24px 20px;
        margin: 0.5rem;
    }
    
    .brand-title {
        font-size: 24px;
    }
    
    .brand-subtitle {
        font-size: 13px;
    }
    
    .sso-container {
        padding: 15px 10px;
    }
    
    .scope-list {
        max-height: 300px;
    }

    /* Register form: single column on mobile */
    .register-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 16. Override body overflow for specific pages */
body.login-page {
    overflow: hidden;
    height: 100vh;
}

body.consent-page {
    overflow: auto;
}

/* 17. Form labels and text adjustments for dark theme */
.form-label {
    color: #CDD9E5; /* subText from Tailwind config */
    font-weight: 500;
    margin-bottom: 8px;
}

.form-check-label {
    color: #CDD9E5; /* subText */
}

.text-muted {
    color: #A6B3C2 !important; /* metaLightGrayText */
}

small.text-muted {
    color: #6C7D90 !important; /* metaPlaceHolder */
}

/* Bootstrap icon colors in input groups */
.input-group-text i {
    color: #CDD9E5; /* subText */
}

/* Alert adjustments for dark background */
.alert-danger {
    background-color: rgba(241, 107, 78, 0.15); /* error */
    color: #F16B4E;
    border: 1px solid rgba(241, 107, 78, 0.3);
}

.alert-warning {
    background-color: rgba(249, 169, 96, 0.15); /* warning */
    color: #F9A960;
    border: 1px solid rgba(249, 169, 96, 0.3);
}

.alert-info {
    background-color: rgba(37, 160, 246, 0.15); /* primary */
    color: #25A0F6;
    border: 1px solid rgba(37, 160, 246, 0.3);
}

/* Text color for general content */
.sso-card p,
.sso-card div {
    color: #CDD9E5; /* subText */
}

/* Brand logo adjustments */
.brand-logo {
    filter: brightness(1.2);
}


