:root {
    --bg-color: #f1f5f9;
    /* Light slate gray background */
    --card-bg: #ffffff;
    /* Solid crisp white form card */
    --input-bg: #ffffff;
    /* Pure white input fields */
    --border-color: #cbd5e1;
    /* Crisp light border */
    --text-main: #0f172a;
    /* Deep slate/navy for main text */
    --text-muted: #475569;
    /* Medium slate for helper text */
    --primary: #1e3a8a;
    /* Academic Oxford Navy */
    --accent-blue: #2563eb;
    /* Academic blue accent */
    --error-red: #dc2626;
    /* Accessible red for validation errors */
    --error-bg: #fef2f2;
    /* Light red toast background */
    --success-green: #059669;
    /* Solid emerald green for valid state */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    width: 100%;
    max-width: 680px;
}

/* Header & Logo */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-img {
    width: 42px;
    height: 42px;
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
    border-radius: 8px;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.header h2 {
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Form Container */
form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

.section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.section h3 span {
    background: var(--primary);
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.sub-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 0.05em;
    margin-top: 8px;
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 580px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Inputs & Form Controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.radio-group .options {
    display: flex;
    gap: 20px;
    margin-top: 4px;
}

.radio-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Primary Button */
.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.2s, opacity 0.2s;
}

.submit-btn:hover {
    background-color: #1d4ed8;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Draft Banner & Validation Feedback */
.draft-banner {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 8px;
    min-height: 20px;
}

.error-toast {
    background-color: var(--error-bg);
    border: 1px solid var(--error-red);
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-toast h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #991b1b;
}

.error-toast ul {
    padding-left: 20px;
    font-size: 0.85rem;
}

.error-toast li {
    margin-bottom: 4px;
}

.field-error {
    color: var(--error-red);
    font-size: 0.8rem;
    display: none;
}

.is-invalid {
    border-color: var(--error-red) !important;
}

.is-valid {
    border-color: var(--success-green) !important;
}

/* Success Card & ID Badge */
.success-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

.id-card {
    background: linear-gradient(135deg, #1e3a8a, #1e1b4b);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 380px;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-align: left;
}

.id-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.id-header h2 {
    font-size: 1rem;
    letter-spacing: 0.05em;
    color: #ffffff;
}

.id-header p {
    font-size: 0.75rem;
    color: #a5b4fc;
}

.id-body {
    display: flex;
    gap: 16px;
    align-items: center;
}

.id-avatar {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.id-info p {
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #e0e7ff;
}

.badge-active {
    background: #059669;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}