/* =====================================================================
   Curriculum Hub — auth pages stylesheet.
   Self-contained: does not depend on landing/static/hub.css.
   ===================================================================== */

/* --- Base --- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: #1a1a1e;
    color: #eae7e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    font-size: 15px;
}

a { color: #a8a49b; }
a:hover { color: #f0ede5; }

/* --- Layout --- */

.auth-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 96px;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 32px;
    border-bottom: 1px solid #333;
}

.hub-name {
    color: #f0ede5;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.2px;
}
.hub-name:hover { color: #fff; }

.auth-header nav {
    display: flex;
    align-items: center;
    gap: 18px;
}
.auth-header nav a,
.auth-header nav .whoami {
    color: #a8a49b;
    text-decoration: none;
    font-size: 14px;
}
.auth-header nav a:hover { color: #f0ede5; }
.auth-header nav .whoami { color: #6a6660; }

/* --- Cards --- */
/* display: block is explicit to defend against any global flex/grid rules
   that might otherwise cascade in. */

.card {
    display: block;
    background: #22222a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 32px 40px;
    max-width: 480px;
    margin: 40px auto;
}
.card.wide {
    max-width: none;
}

.card > * + * { margin-top: 16px; }

.card h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.2px;
}
.card > h2 {
    margin: 32px 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #d4d0c7;
    font-weight: 500;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a30;
}
.card .lead {
    color: #a8a49b;
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
    max-width: 620px;
}

/* --- Forms --- */

form { display: block; }
form label {
    display: block;
    margin: 14px 0;
    color: #d4d0c7;
    font-size: 14px;
}
form label small {
    color: #6a6660;
    font-weight: 400;
    margin-left: 6px;
}
form label.check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 20px;
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    background: #1a1a1e;
    color: #f0ede5;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
}
form input:focus {
    outline: none;
    border-color: #6a6660;
    background: #16161a;
}
button {
    background: #4a4a5c;
    color: #f0ede5;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
}
button:hover { background: #5a5a6c; }
button.danger-btn { background: #5c2a2a; }
button.danger-btn:hover { background: #6c3535; }
button.small { padding: 4px 10px; font-size: 12px; }

/* --- Flash messages --- */

.flash {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 3px solid;
}
.flash-error   { background: #3c1f1f; color: #f0d0d0; border-color: #a04a4a; }
.flash-success { background: #1f3c22; color: #d0f0d5; border-color: #4aa055; }
.flash-info    { background: #1f2b3c; color: #d0dcf0; border-color: #4a6ba0; }

/* --- Utility --- */

.footer-note {
    color: #6a6660;
    font-size: 13px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #2a2a30;
}
.footer-note a { color: #a8a49b; }

.back-link {
    display: inline-block;
    color: #a8a49b;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 8px;
}
.back-link:hover { color: #f0ede5; }

/* --- Account page --- */

.account-info {
    display: grid;
    grid-template-columns: 160px 1fr;
    row-gap: 10px;
    column-gap: 16px;
    margin: 20px 0 32px;
    font-size: 14px;
}
.account-info dt { color: #6a6660; }
.account-info dd { color: #d4d0c7; margin: 0; }

/* --- Admin: two stacked sections --- */

.admin-section {
    margin: 24px 0 40px;
}
.admin-section:last-child { margin-bottom: 0; }

.admin-section > h2 {
    margin: 0 0 6px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #d4d0c7;
    font-weight: 500;
}
.admin-section > .lead {
    margin: 0 0 20px 0;
}

.inline-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px 18px;
    background: #1a1a1e;
    border-radius: 6px;
    border: 1px solid #2a2a30;
}
.inline-form label { margin: 0; min-width: 200px; }
.inline-form label small { color: #6a6660; align-self: center; }
.inline-form .hint {
    color: #6a6660;
    font-size: 12px;
    align-self: center;
    margin-left: auto;
}

/* --- Admin tables --- */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
    table-layout: auto;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a30;
    vertical-align: middle;
}
.admin-table th {
    color: #8a867d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
    background: #1c1c22;
    border-bottom: 1px solid #333;
}
.admin-table tbody tr:hover {
    background: #1e1e25;
}
.admin-table td.empty {
    color: #6a6660;
    text-align: center;
    padding: 32px;
    font-style: italic;
}

/* Column widths so nothing gets crushed */
.admin-table.invites th.col-note,   .admin-table.invites td.col-note   { width: 22%; }
.admin-table.invites th.col-url,    .admin-table.invites td.col-url    { width: 40%; }
.admin-table.invites th.col-date,   .admin-table.invites td.col-date   { width: 11%; white-space: nowrap; }
.admin-table.invites th.col-status, .admin-table.invites td.col-status { width: 8%; }
.admin-table.invites th.col-actions,.admin-table.invites td.col-actions{ width: 8%; text-align: right; }

.admin-table.users th.col-user,     .admin-table.users td.col-user     { width: 18%; }
.admin-table.users th.col-email,    .admin-table.users td.col-email    { width: 22%; }
.admin-table.users th.col-role,     .admin-table.users td.col-role     { width: 10%; }
.admin-table.users th.col-status,   .admin-table.users td.col-status   { width: 10%; }
.admin-table.users th.col-created,  .admin-table.users td.col-created  { width: 12%; white-space: nowrap; }
.admin-table.users th.col-login,    .admin-table.users td.col-login    { width: 16%; white-space: nowrap; }
.admin-table.users th.col-actions,  .admin-table.users td.col-actions  { width: 12%; text-align: right; }

.admin-table code.invite-url {
    display: block;
    background: #1a1a1e;
    padding: 8px 10px;
    border-radius: 4px;
    color: #b8b4a8;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-all;
    overflow-wrap: anywhere;
    border: 1px solid #2a2a30;
}
.admin-table form.inline {
    display: inline-block;
    margin: 0 0 0 4px;
}
.admin-table form.inline:first-child { margin-left: 0; }
.admin-table form.inline button {
    padding: 4px 10px;
    font-size: 11px;
    margin: 0;
}

.you-tag {
    color: #6a6660;
    font-style: italic;
    font-size: 11px;
    margin-left: 4px;
}

/* --- Badges --- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    white-space: nowrap;
}
.badge.active   { background: #1f3c22; color: #a5e0b0; }
.badge.disabled { background: #3c1f1f; color: #e0a5a5; }
.badge.used     { background: #2a2a35; color: #8a867d; }
.badge.expired  { background: #3c331f; color: #e0d0a5; }
.badge.admin    { background: #2a1f3c; color: #d0b0e0; }

/* Narrow screens: let admin sections stack a bit more gracefully */

@media (max-width: 900px) {
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px 6px; }
    .inline-form { flex-direction: column; align-items: stretch; }
    .inline-form label { min-width: auto; }
    .inline-form .hint { margin-left: 0; }
    .card { padding: 24px 20px; }
}

@media (max-width: 600px) {
    .account-info {
        grid-template-columns: 100px 1fr;
        font-size: 13px;
    }
}
