:root {
    --blue: #244b8e;
    --navy: #213b70;
    --gold: #f6c945;
    --background: #f4f6f8;
    --border: #d8e0e9;
    --text: #15202b;
    --muted: #667085;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: Arial, sans-serif;
}

a {
    color: var(--blue);
}

button,
input {
    font: inherit;
}

.app-header {
    border-bottom: 1px solid var(--border);
    background: white;
}

.header-content {
    max-width: 1400px;
    min-height: 76px;
    margin: auto;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--blue);
    text-decoration: none;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 5px solid var(--blue);
    border-radius: 50%;
    font-size: 24px;
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 3px;
    font-size: 9px;
    letter-spacing: 2px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--muted);
}

.dashboard {
    max-width: 1400px;
    margin: auto;
    padding: 32px 28px;
}

.dashboard-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.eyebrow {
    margin: 0;
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.dashboard-heading h1,
.login-card h1 {
    margin: 4px 0 8px;
    font-family: Georgia, serif;
    font-size: 36px;
}

.dashboard-heading p {
    color: var(--muted);
}

.new-rapid-button {
    padding: 13px 20px;
    border: 0;
    border-radius: 12px;
    color: white;
    background: var(--blue);
    font-weight: 700;
}

.new-rapid-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.summary-grid {
    margin: 28px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.summary-card,
.application-panel,
.login-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    box-shadow: 0 2px 8px rgb(21 32 43 / 4%);
}

.summary-card {
    padding: 20px;
}

.summary-line {
    display: block;
    width: 42px;
    height: 5px;
    border-radius: 99px;
    background: var(--blue);
}

.summary-line.gold {
    background: var(--gold);
}

.summary-card p {
    margin: 20px 0 4px;
    color: var(--muted);
}

.summary-card strong {
    font-size: 32px;
}

.application-panel {
    overflow: hidden;
}

.panel-heading {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
    margin: 0;
    font-family: Georgia, serif;
}

.panel-heading p {
    margin: 5px 0 0;
    color: var(--muted);
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 20px;
    border-bottom: 1px solid #e9edf2;
    text-align: left;
}

th {
    color: var(--muted);
    background: #fafbfc;
    font-size: 12px;
    text-transform: uppercase;
}

td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.status-badge {
    padding: 5px 10px;
    border-radius: 99px;
    color: #79580b;
    background: #fff4d6;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

progress {
    width: 90px;
    accent-color: var(--blue);
}

.empty-state {
    padding: 50px;
    color: var(--muted);
    text-align: center;
}

.login-body {
    min-height: 100vh;
}

.login-layout {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(450px, 100%);
    padding: 36px;
}

.gold-line {
    width: 90px;
    height: 7px;
    margin: 26px 0;
    border-radius: 99px;
    background: var(--gold);
}

.description {
    color: var(--muted);
}

.login-card label {
    display: block;
    margin: 20px 0;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

.login-card button {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: var(--blue);
    font-weight: 700;
    cursor: pointer;
}

.error-message {
    padding: 12px;
    border-radius: 9px;
    color: #991b1b;
    background: #fee2e2;
}

.demo-credential {
    margin-top: 20px;
    padding: 13px;
    border-radius: 10px;
    background: #eef3fb;
    font-size: 13px;
}

.demo-credential span {
    display: block;
}

@media (max-width: 900px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .header-content,
    .dashboard {
        padding-left: 16px;
        padding-right: 16px;
    }

    .user-menu span {
        display: none;
    }

    .dashboard-heading {
        display: block;
    }

    .new-rapid-button {
        width: 100%;
        margin-top: 15px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-heading h1 {
        font-size: 29px;
    }

    .login-card {
        padding: 25px;
    }
}

/* Official GGCS logo */
.brand-logo {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.brand > div {
    display: none;
}

.login-card .brand-logo {
    width: 270px;
}

@media (max-width: 640px) {
    .brand-logo {
        width: 185px;
    }

    .login-card .brand-logo {
        width: 230px;
    }
}

/* Rapid Enrollment Application */
.new-rapid-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.rapid-public-body {
    background: #eef1f5;
}

.rapid-page {
    max-width: 1180px;
    margin: 24px auto;
    padding: 0 18px;
}

.rapid-document {
    overflow: hidden;
    border: 1px solid #cad2dd;
    border-radius: 20px;
    background: white;
    box-shadow: 0 10px 35px rgb(29 48 76 / 8%);
}

.rapid-document-content {
    padding: 38px;
}

.rapid-document-header {
    display: grid;
    grid-template-columns: 250px 1fr;
    align-items: center;
    gap: 30px;
}

.rapid-document-logo {
    display: block;
    width: 235px;
    height: auto;
}

.rapid-title-area h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(29px, 4vw, 43px);
    line-height: 1.1;
    text-transform: uppercase;
}

.rapid-title-area p {
    color: var(--muted);
}

.rapid-gold-line {
    height: 12px;
    margin-top: 13px;
    background: var(--gold);
}

.rapid-progress-card {
    margin: 30px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.rapid-progress-card > div {
    display: flex;
    justify-content: space-between;
}

.rapid-progress-card progress {
    width: 100%;
    height: 13px;
    margin: 9px 0 4px;
}

.rapid-progress-card small {
    color: var(--muted);
}

.rapid-form-section {
    margin-top: 30px;
}

.rapid-form-section h2,
.rapid-signature-section h2 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: 19px;
    text-transform: uppercase;
}

.rapid-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid #7f8997;
    border-radius: 9px;
}

.rapid-field-grid label {
    display: grid;
    grid-template-columns: 180px 1fr;
    border-bottom: 1px solid #7f8997;
}

.rapid-field-grid label:nth-child(odd) {
    border-right: 1px solid #7f8997;
}

.rapid-field-grid label > span {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 12px;
    color: white;
    background: var(--navy);
    font-weight: 700;
    line-height: 1.2;
}

.rapid-field-grid input,
.rapid-field-grid textarea,
.rapid-field-grid select {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    margin: 0;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: white;
    font: inherit;
    outline: none;
}

.rapid-field-grid textarea {
    min-height: 95px;
    resize: vertical;
}

.rapid-field-grid input:focus,
.rapid-field-grid textarea:focus,
.rapid-field-grid select:focus {
    background: #f2f6ff;
}

.rapid-wide-field {
    grid-column: 1 / -1;
    border-right: 0 !important;
}

.rapid-signature-section {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

#signatureCanvas {
    display: block;
    width: 100%;
    height: 180px;
    border: 2px solid #7f8997;
    border-radius: 9px 9px 0 0;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.signature-controls {
    min-height: 50px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid #7f8997;
    border-top: 0;
    border-radius: 0 0 9px 9px;
    color: var(--muted);
    background: #f8fafc;
}

.secondary-button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    color: var(--blue);
    background: white;
}

.rapid-date-field input {
    width: 100%;
    min-height: 58px;
    padding: 12px;
    border: 1px solid #7f8997;
    border-radius: 9px;
    background: #f8fafc;
    font: inherit;
}

.rapid-submit-row {
    margin-top: 30px;
    text-align: right;
}

.rapid-submit-row button {
    padding: 14px 24px;
}

.rapid-document-footer {
    padding: 13px;
    color: var(--navy);
    background: var(--gold);
    text-align: center;
    font-size: 12px;
    font-style: italic;
}

.rapid-success-layout {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    place-items: center;
}

.rapid-success-card {
    width: min(630px, 100%);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: white;
    text-align: center;
}

.rapid-success-logo {
    width: 280px;
    max-width: 100%;
}

.success-icon {
    width: 66px;
    height: 66px;
    margin: 28px auto 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: #14805e;
    font-size: 34px;
}

.success-reference {
    padding: 13px;
    border-radius: 10px;
    background: #eef3fb;
}

@media (max-width: 800px) {
    .rapid-document-content {
        padding: 22px 15px;
    }

    .rapid-document-header {
        display: block;
    }

    .rapid-document-logo {
        width: 210px;
        margin-bottom: 22px;
    }

    .rapid-field-grid {
        display: block;
        border: 0;
    }

    .rapid-field-grid label,
    .rapid-wide-field {
        display: block;
        overflow: hidden;
        margin-bottom: 12px;
        border: 1px solid #7f8997 !important;
        border-radius: 9px;
    }

    .rapid-field-grid label > span {
        min-height: 45px;
    }

    .rapid-signature-section {
        grid-template-columns: 1fr;
    }

    .rapid-submit-row button {
        width: 100%;
    }

    .signature-controls {
        font-size: 12px;
    }
}
