@import url("fonts.css");
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter Variable', 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.card {
    background: #1e293b;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.card.wide { max-width: 640px; }

h1 { font-size: 22px; margin-bottom: 4px; color: var(--forge-text, inherit); }
p.subtitle { color: var(--forge-text-muted, #94a3b8); margin-bottom: 24px; font-size: 14px; }

label { display: block; font-size: 13px; margin: 14px 0 6px; color: var(--forge-text-muted, #cbd5e1); }

input, select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--forge-border, #334155);
    background: var(--forge-surface, #0f172a);
    color: var(--forge-text, #f1f5f9);
    font-size: 14px;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--forge-primary, #6366f1);
}

button {
    margin-top: 22px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--forge-primary, #6366f1);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

button:hover { background: var(--forge-primary-hover, #4f46e5); }
button:disabled { background: #475569; cursor: not-allowed; }

.row { display: flex; gap: 12px; }
.row > div { flex: 1; }

.msg {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.msg.error { background: #7f1d1d; color: #fecaca; display: block; }
.msg.success { background: #14532d; color: #bbf7d0; display: block; }

.footer-link { margin-top: 18px; text-align: center; font-size: 13px; color: var(--forge-text-muted, #94a3b8); }
.footer-link a { color: var(--forge-primary, #818cf8); text-decoration: none; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; color: var(--forge-text, inherit); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--forge-border, #334155); }
th { color: var(--forge-text-muted, #94a3b8); font-weight: 600; }

.badge { padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.active { background: #14532d; color: #bbf7d0; }
.badge.inactive { background: #7f1d1d; color: #fecaca; }
/* Module 03 — membership status badges (ACTIVE reuses .badge.active above) */
.badge.pending { background: #78350f; color: #fde68a; }
.badge.expired { background: #334155; color: #cbd5e1; }
.badge.cancelled { background: #7f1d1d; color: #fecaca; }
.badge.suspended { background: #78350f; color: #fde68a; }

.toggle-link { color: #818cf8; cursor: pointer; font-size: 12px; text-decoration: underline; }

/* ---- Password visibility toggle ---- */
.password-field { position: relative; }
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #818cf8;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: auto;
    font-weight: 600;
}
.password-toggle:hover { background: none; color: #a5b4fc; }

/* ---- Toasts ---- */
.toast-container { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.toast {
    min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: 8px;
    font-size: 13px; color: white; box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    opacity: 0; transform: translateX(20px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
.toast.info { background: #475569; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease; z-index: 999;
}
.modal-overlay.show { opacity: 1; }
.modal {
    background: #1e293b; border-radius: 12px; padding: 24px; width: 90%; max-width: 420px;
    transform: scale(0.95); transition: transform 0.2s ease;
}
.modal-overlay.show .modal { transform: scale(1); }
.modal h2 { font-size: 17px; margin-bottom: 14px; }
.modal-body textarea {
    width: 100%; min-height: 90px; padding: 10px 12px; border-radius: 8px;
    border: 1px solid #334155; background: #0f172a; color: #f1f5f9;
    font-size: 14px; font-family: inherit; resize: vertical;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions button { margin-top: 0; width: auto; padding: 8px 16px; font-size: 13px; }
.modal-cancel { background: #334155; }
.modal-confirm.danger { background: #b91c1c; }
.modal-confirm.danger:hover { background: #991b1b; }

/* ---- Empty / loading states ---- */
.state-message { text-align: center; padding: 30px 10px; color: #94a3b8; font-size: 13px; }
.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%;
    animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

tr.row-removing { opacity: 0; transform: translateX(12px); transition: opacity 0.25s ease, transform 0.25s ease; }