/* ============================================================
   Certification Portal — corporate blue design system
   Brand: #0134B3
   ============================================================ */

:root {
    --brand:        #0134B3;
    --brand-dark:   #011F6B;
    --brand-darker: #010F3A;
    --brand-light:  #1E50C7;
    --brand-faint:  rgba(1, 52, 179, 0.18);

    --bg-1: #04102B;
    --bg-2: #071A47;
    --bg-3: #0134B3;

    --glass-bg:        rgba(255, 255, 255, 0.05);
    --glass-bg-strong: rgba(255, 255, 255, 0.08);
    --glass-border:    rgba(255, 255, 255, 0.12);
    --glass-shadow:    0 8px 28px rgba(2, 8, 30, 0.45);

    --text:        #eef2fb;
    --text-muted:  rgba(238, 242, 251, 0.72);
    --text-faint:  rgba(238, 242, 251, 0.45);
    --text-on-light: #0b1228;

    --success: #16a34a;
    --danger:  #dc2626;
    --warning: #d97706;
    --neutral: #64748b;

    --radius:    12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top right, rgba(1, 52, 179, 0.45) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 60%, #02091F 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Card ---------- */

.glass {
    width: 100%;
    max-width: 460px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-top: 3px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    padding: 32px;
}

.glass.wide   { max-width: 1120px; }
.glass.narrow { max-width: 400px;  }

.glass h1,
.glass h2,
.glass h3 {
    margin: 0 0 4px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #ffffff;
}
.glass h2 { font-size: 1.35rem; }
.glass h3 { font-size: 1.05rem; }

.glass .subtitle {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

/* ---------- Form fields ---------- */

label {
    display: block;
    margin: 16px 0 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
select {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.92rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    transition: border-color .15s, background .15s, box-shadow .15s;
    font-family: inherit;
}

input::placeholder { color: var(--text-faint); }

input:focus,
select:focus {
    outline: none;
    border-color: var(--brand-light);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(30, 80, 199, 0.25);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23eef2fb' viewBox='0 0 16 16'%3e%3cpath d='M4 6l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}
select option { color: var(--text-on-light); background: #fff; }

input[type="file"] { padding: 8px 12px; cursor: pointer; font-size: 0.85rem; }
input[type="file"]::-webkit-file-upload-button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-xs);
    padding: 6px 12px;
    margin-right: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
}

.help-text {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: var(--text-faint);
}

/* ---------- Buttons ---------- */

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 11px 18px;
    margin-top: 22px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    font-family: inherit;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.btn:hover,
button:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--brand);
}
.btn:active,
button:active {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: var(--brand-dark);
}
.btn:focus-visible,
button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 80, 199, 0.55);
}
.nav a:focus-visible,
.credit a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
    border-radius: 6px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--text);
}
.btn-ghost:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--brand);
}

.btn-sm {
    width: auto;
    padding: 7px 14px;
    margin-top: 0;
    font-size: 0.8rem;
}

/* ---------- Nav ---------- */

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    width: fit-content;
}
.nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}
.nav a.active {
    background: var(--brand);
    color: #ffffff;
}
.nav a.danger {
    color: rgba(248, 113, 113, 0.95);
}
.nav a.danger:hover {
    background: rgba(220, 38, 38, 0.15);
    color: #fecaca;
}

/* ---------- Alerts ---------- */

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-error   { background: rgba(220, 38, 38, 0.12);
                 border-color: rgba(220, 38, 38, 0.35);
                 color: #fca5a5; }
.alert-success { background: rgba(22, 163, 74, 0.12);
                 border-color: rgba(22, 163, 74, 0.35);
                 color: #86efac; }
.alert-info    { background: rgba(30, 80, 199, 0.18);
                 border-color: rgba(30, 80, 199, 0.4);
                 color: #bfdbfe; }

/* ---------- Status badges ---------- */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.badge-passed { background: rgba(22, 163, 74, 0.15);
                color: #86efac;
                border: 1px solid rgba(22, 163, 74, 0.4); }
.badge-failed { background: rgba(220, 38, 38, 0.15);
                color: #fca5a5;
                border: 1px solid rgba(220, 38, 38, 0.4); }
.badge-na     { background: rgba(100, 116, 139, 0.18);
                color: #cbd5e1;
                border: 1px solid rgba(100, 116, 139, 0.4); }

/* ---------- Results table ---------- */

.table-wrap {
    margin-top: 22px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}
.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.result-table th,
.result-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 280px;
}
.result-table th {
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.result-table tr:last-child td { border-bottom: none; }

.result-table img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: block;
}

.inline-edit {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.inline-edit select {
    width: auto;
    padding: 6px 26px 6px 10px;
    font-size: 0.82rem;
    min-width: 120px;
}
.inline-edit button {
    width: auto;
    margin: 0;
    padding: 6px 14px;
    font-size: 0.78rem;
}

/* ---------- Brand mark ---------- */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    color: #ffffff;
}
.brand-dot {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background-color: var(--brand);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2L3 6v6c0 5 3.5 9.5 9 10 5.5-0.5 9-5 9-10V6l-9-4z' fill='none' stroke='white' stroke-width='1.5' stroke-linejoin='round'/><path d='M8.5 12.2l2.5 2.5 4.5-5' stroke='white' stroke-width='1.9' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(1, 52, 179, 0.35);
}
.brand-dot::after { content: none; }

/* ---------- Footer credit ---------- */

.credit {
    margin: 20px auto 0;
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--text-faint);
}
.credit a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px dotted rgba(238, 242, 251, 0.25);
    padding-bottom: 1px;
    transition: color .15s, border-color .15s;
}
.credit a:hover {
    color: var(--text);
    border-bottom-color: rgba(238, 242, 251, 0.55);
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
    .glass { padding: 24px 20px; }
    .glass h2 { font-size: 1.2rem; }
    .nav { width: 100%; }
    .result-table th,
    .result-table td { padding: 10px 12px; }
    body { padding: 20px 16px; }
}
