/* Aegis Central ID — Global Styles and Design Tokens */

/* --- TYPOGRAPHY: LOCAL FONTS --- */

/* Manrope Regular (400) */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/manrope-v20-latin-regular.woff2') format('woff2'),
         url('../fonts/manrope-v20-latin-regular.ttf') format('truetype');
}

/* Manrope Medium (500) */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/manrope-v20-latin-500.woff2') format('woff2'),
         url('../fonts/manrope-v20-latin-500.ttf') format('truetype');
}

/* Manrope Semi-Bold (600) */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/manrope-v20-latin-600.woff2') format('woff2'),
         url('../fonts/manrope-v20-latin-600.ttf') format('truetype');
}

/* Manrope Bold (700) */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/manrope-v20-latin-700.woff2') format('woff2'),
         url('../fonts/manrope-v20-latin-700.ttf') format('truetype');
}

/* Manrope Extra-Bold (800) */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/manrope-v20-latin-800.woff2') format('woff2'),
         url('../fonts/manrope-v20-latin-800.ttf') format('truetype');
}

/* IBM Plex Mono Regular (400) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-v20-latin-regular.woff2') format('woff2'),
         url('../fonts/ibm-plex-mono-v20-latin-regular.ttf') format('truetype');
}

/* IBM Plex Mono Medium (500) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-v20-latin-500.woff2') format('woff2'),
         url('../fonts/ibm-plex-mono-v20-latin-500.ttf') format('truetype');
}

/* IBM Plex Mono Semi-Bold (600) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-v20-latin-600.woff2') format('woff2'),
         url('../fonts/ibm-plex-mono-v20-latin-600.ttf') format('truetype');
}

/* --- DESIGN TOKENS (CSS VARIABLES) --- */
:root {
    /* Colors */
    --aegis-primary: #0F3D3E;
    --aegis-primary-hover: #14514F;
    --aegis-accent: #B58B2E;
    
    /* Text */
    --aegis-text-strong: #14201F;
    --aegis-text-body: #4E5C5A;
    --aegis-text-secondary: #5C6B69;
    --aegis-text-weak: #6B7A78;
    --aegis-text-very-weak: #8A9795;
    
    /* Surfaces */
    --aegis-bg-card: #FBFAF7;
    --aegis-bg-field: #FFFFFF;
    --aegis-bg-secondary-panel: #F7F5EF;
    --aegis-bg-codebox: #F3F0E8;
    --aegis-bg-page: #E7E4DC;
    
    /* Borders */
    --aegis-border-strong: #D2CCBE;
    --aegis-border-default: #E2DCCF;
    --aegis-border-weak: #EDE8DD;
    --aegis-border-frame: #D9D4C8;
    
    /* Status: Error / Destructive */
    --aegis-error: #8C3A22;
    --aegis-error-hover: #A34428;
    --aegis-error-bg: #FBF0EC;
    --aegis-error-border: #E4C4B8;
    --aegis-error-border-hover: #C98E7A;
    
    /* Status: Success */
    --aegis-success: #2F7A55;
    --aegis-success-bg: #E6F0E9;
    
    /* Status: Warning */
    --aegis-warning: #8C6A1E;
    --aegis-warning-alt: #B0741C;
    --aegis-warning-bg: #F3F0E8;
    
    /* Dark Surface (Knob/button on dark background) */
    --aegis-dark-bg: #14201F;
    --aegis-dark-button: #1E2B2A;
    --aegis-dark-border: #3B4A48;
    
    /* Text on Teal */
    --aegis-text-on-teal: #FBFAF7;
    --aegis-text-on-teal-muted: #DDE7E4;
    --aegis-text-on-teal-muted2: #B9CCC8;
    --aegis-text-on-teal-muted3: #8FA8A4;

    /* Spacing & Radii & Shadows */
    --aegis-radius-field: 8px;
    --aegis-radius-btn-compact: 7px;
    --aegis-radius-card: 10px;
    --aegis-radius-panel: 14px;
    --aegis-radius-mobile: 26px;
    --aegis-radius-mobile-inner: 18px;
    --aegis-radius-pill: 20px;
    
    --aegis-shadow-frame: 0 22px 50px -34px rgba(20, 32, 31, 0.55);
    --aegis-shadow-dialog: 0 30px 60px -30px rgba(20, 32, 31, 0.60);
    
    --aegis-focus-ring: 0 0 0 3px rgba(15, 61, 62, 0.12);
}

/* --- RESET & BASIC STYLING --- */
body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--aegis-bg-page);
    color: var(--aegis-text-body);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Utility Classes */
h1, h2, h3, h4, h5, h6 {
    color: var(--aegis-text-strong);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 0;
    margin-bottom: 0;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

/* Form inputs & Focus states */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    padding: 13px 15px;
    border: 1px solid var(--aegis-border-strong);
    border-radius: var(--aegis-radius-field);
    background-color: var(--aegis-bg-field);
    color: var(--aegis-text-strong);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
    border-color: var(--aegis-primary);
    box-shadow: var(--aegis-focus-ring);
}

@media (max-width: 480px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"] {
        padding: 14px 15px;
        font-size: 16px; /* Prevents iOS zoom */
    }
}

label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--aegis-text-strong);
    display: block;
    margin-bottom: 8px;
}

.label-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--aegis-text-secondary);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--aegis-primary);
    color: var(--aegis-text-on-teal);
    font-weight: 700;
    font-size: 15px;
    padding: 15px 20px;
    border: none;
    border-radius: var(--aegis-radius-field);
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
    gap: 12px;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background-color: var(--aegis-primary-hover);
}

.btn-primary:focus {
    outline: none;
    box-shadow: var(--aegis-focus-ring);
}

/* Shield clip-path Logo */
.aegis-shield {
    width: 38px;
    height: 44px;
    background-color: var(--aegis-accent);
    clip-path: polygon(50% 0%, 100% 22%, 100% 66%, 50% 100%, 0% 66%, 0% 22%);
}

/* --- AUTH SPLIT LAYOUT STYLES --- */
.aegis-auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--aegis-bg-page);
    padding: 40px 20px;
    box-sizing: border-box;
}

.aegis-auth-frame {
    display: flex;
    width: 100%;
    max-width: 750px;
    min-height: 560px;
    justify-content: center;
}

.aegis-auth-container {
    display: flex;
    width: 100%;
    background-color: var(--aegis-bg-card);
    border: 1px solid var(--aegis-border-frame);
    border-radius: var(--aegis-radius-panel);
    box-shadow: var(--aegis-shadow-frame);
    overflow: hidden;
}

/* Left Brand Panel */
.aegis-brand-panel {
    width: 300px;
    background-color: var(--aegis-primary);
    padding: 34px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--aegis-text-on-teal-muted);
    box-sizing: border-box;
    flex-shrink: 0;
}

.aegis-brand-top {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.aegis-logo {
    display: flex;
    align-items: center;
    gap: 11px;
}

.aegis-shield-small {
    width: 30px;
    height: 34px;
    background-color: var(--aegis-accent);
    clip-path: polygon(50% 0, 100% 22%, 100% 66%, 50% 100%, 0 66%, 0 22%);
    flex-shrink: 0;
}

.aegis-logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aegis-logo-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--aegis-text-on-teal);
    line-height: 1;
}

.aegis-logo-subtitle {
    font-size: 9.5px;
    letter-spacing: .18em;
    color: var(--aegis-text-on-teal-muted3);
    line-height: 1;
}

.aegis-promise {
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
    color: #F4F1EA;
    text-wrap: pretty;
}

.aegis-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.aegis-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aegis-feature-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.aegis-bullet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--aegis-accent);
    margin-top: 7px;
    flex-shrink: 0;
}

.aegis-feature-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--aegis-text-on-teal-muted2);
}

.aegis-brand-bottom {
    font-size: 10px;
    letter-spacing: .08em;
    color: #7C9591;
}

/* Right Content Panel */
.aegis-content-panel {
    flex: 1;
    padding: 44px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--aegis-bg-card);
    box-sizing: border-box;
}

.aegis-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
}

.aegis-header-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.aegis-title {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--aegis-text-strong);
    line-height: 1.2;
}

.aegis-subtitle {
    font-size: 14px;
    line-height: 1.55;
    color: var(--aegis-text-secondary);
}

/* Error Banner */
.aegis-error-banner {
    display: flex;
    gap: 11px;
    background-color: var(--aegis-error-bg);
    border: 1px solid var(--aegis-error-border);
    border-radius: 8px;
    padding: 13px 15px;
    box-sizing: border-box;
}

.aegis-error-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--aegis-error);
}

/* Input Wrappers */
.aegis-input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aegis-label-wrapper {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
}

.aegis-label-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--aegis-text-secondary);
}

/* Actions area */
.aegis-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aegis-checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--aegis-text-body);
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
    margin-bottom: 0;
}

.aegis-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--aegis-primary);
    cursor: pointer;
    margin: 0;
}

.aegis-link {
    font-size: 13.5px;
    color: var(--aegis-primary);
    text-decoration: none;
    font-weight: 600;
}

.aegis-link:hover {
    text-decoration: underline;
}

/* Divider 'ELLER' */
.aegis-or-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.aegis-or-line {
    flex: 1;
    height: 1px;
    background-color: var(--aegis-border-default);
}

.aegis-or-text {
    font-size: 11.5px;
    letter-spacing: .1em;
    color: var(--aegis-text-very-weak);
    font-weight: 700;
}

/* Federation Buttons */
.aegis-federation-row {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    flex: 1;
    border: 1px solid var(--aegis-border-strong);
    background-color: var(--aegis-bg-field);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--aegis-text-strong);
    padding: 12px;
    border-radius: var(--aegis-radius-field);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--aegis-primary);
}

.btn-secondary:focus {
    outline: none;
    box-shadow: var(--aegis-focus-ring);
}

/* RESPONSIVE LAYOUT COLLAPSE */
@media (max-width: 900px) {
    .aegis-auth-body {
        padding: 0;
        background-color: var(--aegis-bg-card);
    }

    .aegis-auth-frame {
        max-width: 100%;
        min-height: 100vh;
    }

    .aegis-auth-container {
        flex-direction: column;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .aegis-brand-panel {
        width: 100%;
        padding: 24px 20px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .aegis-brand-top {
        gap: 0;
    }

    .aegis-promise,
    .aegis-divider,
    .aegis-features,
    .aegis-brand-bottom {
        display: none; /* Hide decorative items on mobile */
    }

    .aegis-content-panel {
        padding: 40px 20px;
        justify-content: flex-start;
    }

    .aegis-federation-row {
        flex-direction: column;
    }
}

/* --- MFA CODE BOXES --- */
.aegis-mfa-container {
    position: relative;
    width: 100%;
}

.aegis-mfa-boxes {
    display: flex;
    gap: 9px;
    width: 100%;
}

.aegis-mfa-box {
    flex: 1;
    aspect-ratio: 1 / 1.15;
    border: 1px solid var(--aegis-border-strong);
    border-radius: 9px;
    background-color: var(--aegis-bg-field);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 25px;
    font-weight: 600;
    color: var(--aegis-text-strong);
    user-select: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.aegis-mfa-box.active {
    border-color: var(--aegis-primary);
    box-shadow: var(--aegis-focus-ring);
}

.aegis-mfa-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: text;
    border: none;
    background: transparent;
    font-size: 24px;
    outline: none;
}

.aegis-mfa-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--aegis-text-weak);
}

.aegis-mfa-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--aegis-accent);
}

/* --- CONSENT VIEW --- */
.aegis-consent-avatars {
    display: flex;
    align-items: center;
    gap: 13px;
}

.aegis-avatar-client {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background-color: var(--aegis-primary);
    color: var(--aegis-text-on-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}

.aegis-avatar-arrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--aegis-text-very-weak);
}

.aegis-avatar-shield {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background-color: var(--aegis-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aegis-avatar-shield-shape {
    width: 18px;
    height: 20px;
    background-color: var(--aegis-bg-card);
    clip-path: polygon(50% 0, 100% 22%, 100% 66%, 50% 100%, 0 66%, 0 22%);
}

.aegis-consent-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--aegis-bg-secondary-panel);
    border: 1px solid var(--aegis-border-default);
    border-radius: 10px;
    padding: 17px 18px;
    box-sizing: border-box;
}

.aegis-consent-item {
    display: flex;
    gap: 11px;
    align-items: flex-start;
}

.aegis-consent-bullet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--aegis-primary);
    margin-top: 7px;
    flex-shrink: 0;
}

.aegis-consent-item-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: #2B3A38;
}

.aegis-consent-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

/* --- TENANT SELECTOR VIEW --- */
.aegis-tenant-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.aegis-tenant-card {
    text-align: left;
    border: 1px solid var(--aegis-border-strong);
    background-color: var(--aegis-bg-field);
    border-radius: 10px;
    padding: 16px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    outline: none;
}

.aegis-tenant-card:hover {
    border-color: var(--aegis-primary);
}

.aegis-tenant-card:focus {
    box-shadow: var(--aegis-focus-ring);
    border-color: var(--aegis-primary);
}

.aegis-tenant-card.active {
    border-color: var(--aegis-primary);
}

.aegis-tenant-card.inactive {
    opacity: 0.55;
    cursor: not-allowed;
}

.aegis-tenant-avatar {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background-color: var(--aegis-bg-page);
    color: var(--aegis-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
}

.aegis-tenant-avatar.active {
    background-color: var(--aegis-primary);
    color: var(--aegis-text-on-teal);
}

.aegis-tenant-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.aegis-tenant-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--aegis-text-strong);
    line-height: 1.2;
}

.aegis-tenant-role {
    font-size: 12.5px;
    color: var(--aegis-text-secondary);
}

.aegis-tenant-arrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--aegis-text-very-weak);
}
