/* ============================================================
   Posthum.ai — App Styles (design system aligné sur le site front)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Mono:wght@300;400&family=Outfit:wght@200;300;400&display=swap');

/* ── VARIABLES (mêmes tokens que le site front) ── */
:root {
    --ink: #0a0a0f;
    --void: #050508;
    --ash: #1a1a2e;
    --mist: #8a8aa0;
    --silver: #c8c8d8;
    --gold: #c9a96e;
    --gold-light: #e8d5b0;
    --white: #f0eff5;
    --accent: #7c6fa0;

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

    --nav-height: 64px;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.35s ease;
}

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

html {
    font-size: 16px;
}

body {
    background: var(--void);
    color: var(--white);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Grain overlay (identique au site front) */
body::before {
    content: '';
    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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.35;
    pointer-events: none;
    z-index: 9000;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-light);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 1.2;
}

/* ── Layout ── */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.page-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

/* ── Card ── */
.card {
    background: rgba(26, 26, 46, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2.5rem 2rem;
    position: relative;
}

/* Crochets dorés (esthétique Posthum) */
.card::before,
.card::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: rgba(201, 169, 110, 0.3);
    border-style: solid;
}

.card::before {
    top: -1px;
    left: -1px;
    border-width: 1px 0 0 1px;
}

.card::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 1px 1px 0;
}

.card h1 {
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 0.35rem;
}

.card .subtitle {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--mist);
    text-transform: uppercase;
    margin-bottom: 2rem;
}

/* ── Form ── */
.form-group {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    color: var(--mist);
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--white);
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 300;
    outline: none;
    transition: border-color var(--transition-fast);
    -webkit-appearance: none;
    border-radius: 0;
}

input:focus,
textarea:focus {
    border-color: rgba(201, 169, 110, 0.5);
}

input::placeholder,
textarea::placeholder {
    color: rgba(138, 138, 160, 0.35);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-medium);
    width: 100%;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--gold);
    color: var(--void);
}

.btn-primary:hover:not(:disabled) {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 169, 110, 0.28);
}

.btn-secondary {
    background: transparent;
    color: var(--silver);
    border: 1px solid rgba(200, 200, 216, 0.22);
}

.btn-secondary:hover:not(:disabled) {
    border-color: rgba(200, 200, 216, 0.6);
    color: var(--white);
}

/* ── Alerts ── */
.alert {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-left: 2px solid transparent;
    line-height: 1.5;
}

.alert-error {
    background: rgba(220, 80, 80, 0.08);
    border-left-color: rgba(220, 80, 80, 0.6);
    color: #e8939a;
}

.alert-success {
    background: rgba(100, 200, 150, 0.08);
    border-left-color: rgba(100, 200, 150, 0.5);
    color: #8dd8b0;
}

.alert-info {
    background: rgba(201, 169, 110, 0.07);
    border-left-color: rgba(201, 169, 110, 0.4);
    color: var(--gold-light);
}

.alert.hidden {
    display: none;
}

/* ── NAVIGATION ── */
nav {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(5, 5, 8, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 100;
}

nav .brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--gold);
    text-decoration: none;
}

nav .brand span {
    font-style: italic;
    color: var(--mist);
    font-size: 0.9em;
}

nav .nav-links a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mist);
    margin-left: 1.5rem;
    transition: color var(--transition-fast);
}

nav .nav-links a:hover {
    color: var(--gold);
    text-decoration: none;
}

/* ── Table ── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th,
td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mist);
    font-weight: 400;
}

tr:last-child td {
    border-bottom: none;
}

/* ── Utility ── */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.text-muted {
    color: var(--mist);
    font-size: 0.82rem;
}

.text-muted a {
    color: var(--gold);
    opacity: 0.8;
}

.text-muted a:hover {
    opacity: 1;
    color: var(--gold-light);
}

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

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