/* ============================================================
   AntiCorruption — secure reporting platform
   Visual system: "encrypted vault"
   Ink navy + verified teal · Space Grotesk / Inter / mono codes
   Drop-in replacement for static/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    --ink:        #0d1723;   /* deep navy-black — nav, headings */
    --ink-2:      #16283b;   /* raised ink */
    --bg:         #eaeef4;   /* cool page background */
    --bg-2:       #dfe5ee;
    --surface:    #ffffff;   /* cards, container */
    --surface-2:  #f5f7fb;   /* inset panels */
    --line:       #e3e8f0;   /* hairlines */
    --line-strong:#d3dbe6;
    --text:       #1c2836;   /* body */
    --muted:      #5f6f82;   /* secondary */
    --faint:      #8695a6;   /* tertiary */

    --brand:      #0e8f88;   /* verified teal — primary actions */
    --brand-dark: #0a6f6a;
    --brand-soft: #e2f4f2;
    --brand-ring: rgba(14,143,136,.28);

    --danger:     #d6413f;
    --danger-dark:#b5302f;
    --danger-soft:#fdeaea;
    --success:    #128a55;
    --success-soft:#e4f5ec;
    --warning:    #c47a10;
    --warning-soft:#fbf1dc;

    --radius:     14px;
    --radius-sm:  9px;
    --shadow:     0 1px 2px rgba(13,23,35,.04), 0 12px 30px -12px rgba(13,23,35,.18);
    --shadow-sm:  0 1px 2px rgba(13,23,35,.06), 0 4px 12px -6px rgba(13,23,35,.12);
    --ease:       cubic-bezier(.2,.7,.3,1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    background:
        radial-gradient(1100px 520px at 82% -8%, #f2f5fa 0%, rgba(242,245,250,0) 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ------------------------------------------------ Navbar */
.navbar {
    background: linear-gradient(180deg, #10202f 0%, var(--ink) 100%);
    padding: 0 clamp(18px, 4vw, 40px);
    height: 62px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 1px 0 rgba(14,143,136,.35), 0 6px 22px -12px rgba(0,0,0,.6);
}

.navbar .brand {
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.navbar .brand:hover { text-decoration: none; opacity: .92; }
.navbar .brand { white-space: nowrap; }

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.navbar .nav-links a {
    color: #b7c4d3;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    padding: 8px 13px;
    border-radius: 8px;
    text-decoration: none;
    transition: color .18s var(--ease), background .18s var(--ease);
}
.navbar .nav-links a:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    text-decoration: none;
}

/* ------------------------------------------------ Container */
.container {
    max-width: 920px;
    margin: 36px auto 64px;
    background: var(--surface);
    padding: clamp(24px, 4vw, 42px);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    position: relative;
    animation: rise .5s var(--ease) both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------ Headings */
h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
    font-size: clamp(22px, 3.4vw, 27px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-bottom: 22px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
h2::before {
    content: "";
    width: 4px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(var(--brand), var(--brand-dark));
    flex: none;
}

h3 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 28px 0 12px;
}

h4 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
}

p { color: var(--text); }

/* ------------------------------------------------ Links */
a { color: var(--brand-dark); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------ Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 17px;
    max-width: 440px;
}
form > div { display: flex; flex-direction: column; gap: 6px; }

form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: .01em;
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
form textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
form input::placeholder, form textarea::placeholder { color: var(--faint); }

form input:focus,
form textarea:focus,
form select:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}

/* The 2FA code box reads as a cryptographic input */
form input[name="code"] {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 22px;
    letter-spacing: .5em;
    text-align: center;
    padding-left: .5em;
}

/* Submit buttons + native buttons */
form input[type="submit"],
button {
    align-self: flex-start;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: 0 1px 2px rgba(10,111,106,.35), 0 6px 16px -8px rgba(10,111,106,.6);
    transition: transform .12s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease);
}
form input[type="submit"]:hover,
button:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 4px rgba(10,111,106,.4), 0 10px 22px -8px rgba(10,111,106,.7);
    transform: translateY(-1px);
}
form input[type="submit"]:active,
button:active { transform: translateY(0); }

/* ------------------------------------------------ Buttons (links) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform .12s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(10,111,106,.35), 0 6px 16px -8px rgba(10,111,106,.55);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { color: var(--ink); border-color: var(--brand); background: var(--brand-soft); }

.btn-danger {
    background: linear-gradient(180deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(181,48,47,.3), 0 6px 16px -8px rgba(181,48,47,.5);
}
.btn-danger:hover { color: #fff; filter: brightness(1.05); }

/* ------------------------------------------------ Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 6px;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
th {
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover, table tr:hover { background: var(--surface-2); }
td a { font-weight: 600; }

/* ------------------------------------------------ Alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid transparent;
}
.alert::before { font-size: 15px; line-height: 1.5; flex: none; }
.alert-error   { background: var(--danger-soft);  color: var(--danger-dark);  border-color: rgba(214,65,63,.25); }
.alert-error::before   { content: "⚠"; }
.alert-success { background: var(--success-soft); color: var(--success);      border-color: rgba(18,138,85,.25); }
.alert-success::before { content: "✓"; }
.alert-warning { background: var(--warning-soft); color: var(--warning);      border-color: rgba(196,122,16,.28); }
.alert-warning::before { content: "!"; font-weight: 700; }

/* ------------------------------------------------ Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 22px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.card h4 { margin-bottom: 8px; }
.card p { color: var(--muted); }
.card .actions { margin-top: 14px; }

/* ------------------------------------------------ Profile */
.profile-info { padding: 6px 22px; }
.profile-info p {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    color: var(--text);
}
.profile-info p:last-child { border-bottom: none; }
.profile-info p span:first-child {
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    display: inline-block;
    width: 96px;
    flex: none;
}

/* ------------------------------------------------ Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1.4;
    vertical-align: middle;
}
.badge-admin {
    background: var(--ink);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.badge-user {
    background: var(--brand-soft);
    color: var(--brand-dark);
    box-shadow: inset 0 0 0 1px rgba(14,143,136,.2);
}

/* ------------------------------------------------ QR / crypto artifacts */
.container img[src*="qr"], .container img[src*="qrserver"] {
    background: #fff;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px !important;
    box-shadow: var(--shadow-sm);
}
/* Manual 2FA secret / tokens rendered in <b> read as monospace keys */
.alert + p b, p b {
    font-family: inherit;
}

/* ------------------------------------------------ Actions rows */
.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.actions a { margin-right: 0; }
td.actions { gap: 14px; }

/* ------------------------------------------------ Utility */
.mt { margin-top: 22px; }
.mb { margin-bottom: 22px; }

/* Home hero spacing tweak: the two CTA buttons */
.container > div[style*="display:flex"] .btn { padding: 12px 22px; }

/* ------------------------------------------------ Responsive */
@media (max-width: 640px) {
    .container { margin: 18px 12px 40px; border-radius: 12px; }
    .navbar { height: 56px; padding: 0 14px; gap: 8px; }
    .navbar .brand { font-size: 16px; gap: 6px; }
    .navbar .nav-links { gap: 0; }
    .navbar .nav-links a { padding: 6px 7px; font-size: 12.5px; }
    form { max-width: 100%; }
    table { font-size: 13px; }
    th, td { padding: 10px 11px; }
    .profile-info p { flex-direction: column; align-items: flex-start; gap: 3px; }
    .profile-info p span:first-child { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}