/* ============================================================================
   Chiron Consulting -- Secure Access Portal
   Design: Dark luxury, authoritative, precision security aesthetic
   Palette: Deep charcoal, burnished gold, signal green
   ============================================================================ */

:root {
    --bg-void:       #0A0A0B;
    --bg-surface:    #111113;
    --bg-elevated:   #18181C;
    --bg-card:       #1E1E23;
    --bg-card-hover: #242429;

    --gold-bright:   #C9A84C;
    --gold-dim:      #8A7235;
    --gold-ghost:    rgba(201, 168, 76, 0.08);
    --gold-border:   rgba(201, 168, 76, 0.2);

    --green-signal:  #4CAF82;
    --red-alert:     #E05252;
    --blue-info:     #5B8FD4;

    --text-primary:  #E8E4DC;
    --text-secondary:#9A9490;
    --text-muted:    #5A5652;
    --text-gold:     #C9A84C;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-mid:    rgba(255, 255, 255, 0.1);

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-ui:      'Syne', system-ui, sans-serif;
    --font-mono:    'DM Mono', 'Courier New', monospace;

    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  16px;

    --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255,255,255,0.04) inset;
    --shadow-glow: 0 0 40px rgba(201, 168, 76, 0.12);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ── Noise Texture Overlay ────────────────────────────────────────────────── */

.noise-overlay {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* Background grid */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(201, 168, 76, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 168, 76, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    z-index: 0;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.portal-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(10,10,11,0.98) 0%, rgba(10,10,11,0.9) 100%);
    backdrop-filter: blur(12px);
    padding: 0 2rem;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
    opacity: 0.9;
    animation: brand-pulse 4s ease-in-out infinite;
}

@keyframes brand-pulse {
    0%, 100% { opacity: 0.9; }
    50%       { opacity: 0.7; }
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.brand-tagline {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--green-signal);
    letter-spacing: 0.08em;
    opacity: 0.8;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */

.portal-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* ── Auth Selection Card ──────────────────────────────────────────────────── */

.auth-container {
    width: 100%;
    max-width: 520px;
    animation: container-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes container-enter {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-eyebrow::before, .auth-eyebrow::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--text-muted);
    opacity: 0.5;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.auth-title em {
    font-style: italic;
    color: var(--gold-bright);
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Method Grid ──────────────────────────────────────────────────────────── */

.method-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.method-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    animation: card-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.method-card:nth-child(1) { animation-delay: 0.1s; }
.method-card:nth-child(2) { animation-delay: 0.15s; }
.method-card:nth-child(3) { animation-delay: 0.2s; }
.method-card:nth-child(4) { animation-delay: 0.25s; }

@keyframes card-enter {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.method-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gold-bright);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.method-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-border);
    transform: translateX(3px);
    box-shadow: var(--shadow-glow);
}

.method-card:hover::before { opacity: 1; }

.method-card.primary {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.08) 0%, var(--bg-card) 60%);
    border-color: var(--gold-border);
}

.method-card.primary::before { opacity: 0.5; }

.method-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.method-card.primary .method-icon {
    background: var(--gold-ghost);
    border-color: var(--gold-border);
}

.method-content { flex: 1; }

.method-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    letter-spacing: 0.01em;
}

.method-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.method-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 100px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.method-badge.recommended {
    background: var(--gold-ghost);
    border: 1px solid var(--gold-border);
    color: var(--gold-bright);
}

.method-badge.standard {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.method-arrow {
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.method-card:hover .method-arrow {
    transform: translateX(4px);
    color: var(--gold-bright);
}

/* ── Divider ──────────────────────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ── Forms ────────────────────────────────────────────────────────────────── */

.auth-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    animation: container-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    letter-spacing: 0.04em;
}

.form-input:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.form-input::placeholder { color: var(--text-muted); }

/* OTP Code input */
.otp-input {
    font-size: 1.75rem;
    letter-spacing: 0.4em;
    text-align: center;
    font-weight: 300;
    padding: 16px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
    text-decoration: none;
}

.btn-primary {
    background: var(--gold-bright);
    color: #0A0A0B;
}

.btn-primary:hover {
    background: #D4B460;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-mid);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--border-mid);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.btn-ghost:hover { color: var(--text-primary); }

.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ── Push Notification Flow ───────────────────────────────────────────────── */

.push-waiting {
    text-align: center;
    padding: 2rem 0;
}

.push-animation {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.push-phone {
    width: 40px;
    height: 64px;
    border: 2px solid var(--gold-bright);
    border-radius: 8px;
    margin: 0 auto;
    position: relative;
}

.push-phone::before {
    content: '';
    width: 12px;
    height: 2px;
    background: var(--gold-bright);
    border-radius: 1px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.push-ripple {
    position: absolute;
    inset: -16px;
    border: 1px solid var(--gold-bright);
    border-radius: 50%;
    animation: push-ripple 2s ease-out infinite;
    opacity: 0;
}

.push-ripple:nth-child(2) { animation-delay: 0.6s; }
.push-ripple:nth-child(3) { animation-delay: 1.2s; }

@keyframes push-ripple {
    0%   { opacity: 0.6; transform: scale(0.5); }
    100% { opacity: 0;   transform: scale(1.5); }
}

.push-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-top: 1rem;
}

/* ── QR Code (TOTP Enrollment) ────────────────────────────────────────────── */

.qr-container {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 16px;
    display: inline-block;
    margin: 1rem auto;
}

.qr-container img { display: block; width: 200px; height: 200px; }

.secret-display {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    letter-spacing: 0.15em;
    word-break: break-all;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.secret-display:hover { border-color: var(--gold-border); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: rgba(224, 82, 82, 0.08);
    border: 1px solid rgba(224, 82, 82, 0.25);
    color: #F08080;
}

.alert-success {
    background: rgba(76, 175, 130, 0.08);
    border: 1px solid rgba(76, 175, 130, 0.25);
    color: var(--green-signal);
}

.alert-info {
    background: rgba(91, 143, 212, 0.08);
    border: 1px solid rgba(91, 143, 212, 0.25);
    color: var(--blue-info);
}

/* ── Back Link ────────────────────────────────────────────────────────────── */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.back-link:hover { color: var(--gold-bright); }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.portal-footer {
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.footer-inner a {
    color: var(--gold-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-inner a:hover { color: var(--gold-bright); }

.footer-sep { opacity: 0.3; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .portal-main    { padding: 1.5rem 1rem; align-items: flex-start; }
    .auth-title     { font-size: 1.75rem; }
    .auth-form-card { padding: 1.5rem; }
    .header-meta    { display: none; }
}
