/* ============================================================
   Bourgoin Services Financiers — Portail Documents
   Brand Stylesheet v2.0 — Full brand personality
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* --- Brand Tokens --- */
:root {
    /* Pure deep blacks — no tint */
    --obsidian: #0A0A0A;
    --carbon: #111111;
    --slate: #161616;
    --graphite: #1E1E1E;
    --edge: #282828;

    /* Text */
    --text-primary: #E5E5E5;
    --text-secondary: #8A8A8A;
    --text-muted: #5A5A5A;

    /* Identity Layer — Gold */
    --gold: #C8A55A;
    --gold-bright: #D4B76E;
    --gold-dim: #A68A42;
    --gold-glow: rgba(200, 165, 90, 0.08);

    /* Tech Layer — Cyan */
    --cyan: #00E0FF;
    --cyan-bright: #40EEFF;
    --cyan-dim: #00B0CC;
    --cyan-glow: rgba(0, 224, 255, 0.06);
    --cyan-glow-strong: rgba(0, 224, 255, 0.12);

    /* Utility */
    --ivory: #F5F5F5;
    --success: #2ECC71;
    --error: #E74C3C;
    --warning: #F39C12;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--obsidian);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* --- Data Grid Background (tech layer) --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 224, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 224, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* --- Ambient Cyan Glow (radial, behind card) --- */
body::after {
    content: '';
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, var(--cyan-glow), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- Page Wrapper --- */
.page-wrapper {
    width: 100%;
    max-width: 560px;
    padding: 48px 24px 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* ============================================================
   LOGO
   ============================================================ */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 36px;
    text-decoration: none;
}

.logo-wordmark {
    font-family: 'Manrope', sans-serif;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--ivory);
    line-height: 1.2;
}

.logo-wordmark .dot {
    color: var(--gold);
}

.logo-legal {
    font-family: 'Manrope', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
    background-color: var(--carbon);
    border: 1px solid var(--graphite);
    border-radius: 10px;
    padding: 40px 32px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Gold accent top border — identity layer */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent 70%);
}

/* Surgical tear watermark inside card */
.card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -10px;
    width: 200px;
    height: 160px;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 80'%3E%3Cpath d='M10,28 Q12,34 10,52 Q8,34 10,28 Z' fill='%23C8A55A' opacity='0.2'/%3E%3Cpath d='M21,18 Q23.5,28 21,62 Q18.5,28 21,18 Z' fill='%23C8A55A' opacity='0.4'/%3E%3Cpath d='M33,9 Q36,22 33,71 Q30,22 33,9 Z' fill='%23C8A55A' opacity='0.65'/%3E%3Cpath d='M46,2 Q49.5,18 46,78 Q42.5,18 46,2 Z' fill='%23C8A55A' opacity='1'/%3E%3Cpath d='M59,9 Q62,22 59,71 Q56,22 59,9 Z' fill='%23C8A55A' opacity='0.65'/%3E%3Cpath d='M71,18 Q73.5,28 71,62 Q68.5,28 71,18 Z' fill='%23C8A55A' opacity='0.4'/%3E%3Cpath d='M82,28 Q84,34 82,52 Q80,34 82,28 Z' fill='%23C8A55A' opacity='0.2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.card-header {
    margin-bottom: 24px;
}

.card-label {
    font-family: 'Manrope', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold-dim);
    opacity: 0.6;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-label::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--gold);
}

.card-title {
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Divider (gradient, like brand bible) --- */
.divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
    margin: 24px 0;
}

/* ============================================================
   BUTTONS — "Cyan breathes"
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 14px 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1;
    position: relative;
}

.btn-primary {
    background-color: var(--cyan);
    color: var(--obsidian);
    box-shadow: 0 0 20px rgba(0, 224, 255, 0.1);
}

.btn-primary:hover {
    background-color: var(--cyan-bright);
    box-shadow:
        0 0 30px rgba(0, 224, 255, 0.2),
        0 0 60px rgba(0, 224, 255, 0.05);
    transform: translateY(-1px);
}

.btn-primary:active {
    background-color: var(--cyan-dim);
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(0, 224, 255, 0.1);
}

.btn-primary:disabled {
    background-color: var(--edge);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Cyan pulse animation on idle CTA */
@keyframes cyanPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 224, 255, 0.08); }
    50% { box-shadow: 0 0 30px rgba(0, 224, 255, 0.18), 0 0 60px rgba(0, 224, 255, 0.04); }
}

.btn-primary.pulse {
    animation: cyanPulse 3s ease-in-out infinite;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--edge);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background-color: var(--slate);
}

.btn-full {
    width: 100%;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--obsidian);
    border: 1px solid var(--edge);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: var(--cyan-dim);
    box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.06), 0 0 20px rgba(0, 224, 255, 0.04);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

/* Show a subtle red border only AFTER the user has interacted with the field
   and left it in an invalid state. :user-invalid (vs :invalid) prevents the
   error styling from showing on first page load when the input is empty by
   default. Falls back gracefully on older browsers — they just don't get the
   red border, the form still validates server-side. */
.form-input:user-invalid {
    border-color: var(--error);
}
.form-input:user-invalid:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ============================================================
   DROPZONE — Secure intake portal feel
   ============================================================ */
.dropzone {
    border: 1px dashed var(--edge);
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--obsidian);
    position: relative;
    overflow: hidden;
}

/* Subtle inner glow on hover */
.dropzone:hover {
    border-color: var(--cyan-dim);
    background-image: radial-gradient(ellipse at center, rgba(0, 224, 255, 0.03), transparent 70%);
}

.dropzone.dragover {
    border-color: var(--cyan);
    border-style: solid;
    background-image: radial-gradient(ellipse at center, rgba(0, 224, 255, 0.06), transparent 70%);
    box-shadow: inset 0 0 40px rgba(0, 224, 255, 0.03), 0 0 30px rgba(0, 224, 255, 0.05);
}

/* Animated dashed border on dragover */
@keyframes borderDash {
    to { stroke-dashoffset: -20; }
}

.dropzone-label {
    font-family: 'Manrope', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cyan-dim);
    opacity: 0.5;
    margin-bottom: 20px;
}

.dropzone-icon {
    margin-bottom: 16px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.dropzone:hover .dropzone-icon {
    opacity: 0.7;
}

.dropzone-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.dropzone-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.dropzone-link {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.dropzone-link:hover {
    color: var(--cyan-bright);
    text-decoration: underline;
}

/* ============================================================
   FILE LIST
   ============================================================ */
.file-list {
    list-style: none;
    margin-top: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--obsidian);
    border: 1px solid var(--edge);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.file-item:hover {
    border-color: var(--graphite);
}

.file-item-icon {
    color: var(--gold-dim);
    margin-right: 10px;
    font-size: 14px;
    opacity: 0.6;
}

.file-item-name {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
    font-size: 13px;
}

.file-item-size {
    color: var(--text-muted);
    font-size: 11px;
    font-family: 'Manrope', sans-serif;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.file-item-remove {
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 12px;
    font-size: 14px;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 2px 6px;
}

.file-item-remove:hover {
    color: var(--error);
}

/* ============================================================
   PROGRESS BAR — Cyan glow
   ============================================================ */
.progress-bar {
    width: 100%;
    height: 3px;
    background-color: var(--edge);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 20px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
    border-radius: 2px;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px rgba(0, 224, 255, 0.3);
}

/* ============================================================
   STATUS PAGES — Classified / intelligence aesthetic
   ============================================================ */
.status-page {
    text-align: center;
    padding: 48px 32px;
}

.status-classification {
    font-family: 'Manrope', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 28px;
}

.status-icon {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon svg {
    opacity: 0.8;
}

.status-title {
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 12px;
}

.status-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 380px;
    margin: 0 auto;
}

.status-code {
    font-family: 'Manrope', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--edge);
    margin-top: 28px;
}

/* Status color variants */
.status-icon--error svg { color: var(--error); }
.status-icon--warning svg { color: var(--warning); }
.status-icon--info svg { color: var(--cyan); }
.status-icon--success svg { color: var(--success); }

/* ============================================================
   SUCCESS / CONFIRMATION BOX
   ============================================================ */
.success-box {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.06), rgba(46, 204, 113, 0.02));
    border: 1px solid rgba(46, 204, 113, 0.15);
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-box-icon {
    color: var(--success);
    flex-shrink: 0;
}

.success-box p {
    color: var(--success);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================================
   CODE DISPLAY (OTP — legacy)
   ============================================================ */
.code-display {
    font-family: 'Manrope', sans-serif;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--cyan);
    text-align: center;
    padding: 24px;
    background-color: var(--obsidian);
    border: 1px solid var(--edge);
    border-radius: 8px;
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(0, 224, 255, 0.2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    width: 100%;
    max-width: 560px;
    padding: 32px 24px 24px;
    text-align: center;
    margin-top: auto;
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
    margin: 0 auto 16px;
}

.footer-text {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.footer-legal {
    font-size: 10px;
    color: var(--edge);
    margin-top: 4px;
    letter-spacing: 0.01em;
}

/* ============================================================
   GOLD DOT SYSTEM — Brand punctuation
   ============================================================ */
.gold-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--gold);
    vertical-align: middle;
}

.gold-dot--lg {
    width: 6px;
    height: 6px;
}

.gold-accent-line {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    margin: 24px auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .page-wrapper {
        padding: 32px 16px 24px;
    }

    .card {
        padding: 32px 20px;
    }

    .logo-wordmark {
        font-size: 26px;
    }

    .dropzone {
        padding: 36px 16px;
    }

    .status-page {
        padding: 36px 20px;
    }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Fade in on page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease-out;
}

.logo {
    animation: fadeInUp 0.4s ease-out;
}

/* Scan line — subtle classified aesthetic */
@keyframes scanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}
