/* =========================================
   APPLICATION PAGE
========================================= */

.application-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f7fb;
}

/* =========================================
   HEADER
========================================= */

.application-header {
    height: 128px;
    padding: 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(126,31,63,0.10), transparent 26%),
        radial-gradient(circle at top left, rgba(126,31,63,0.05), transparent 22%),
        linear-gradient(180deg, #ffffff 0%, #fff8fa 100%);
    box-shadow: 0 3px 14px rgba(15,23,42,0.04);
    flex-shrink: 0;
}

.application-header::before {
    content: "";
    position: absolute;
    top: -140px;
    right: -80px;
    width: 700px;
    height: 320px;
    background:
        radial-gradient(
            ellipse at center,
            rgba(126,31,63,0.10) 0%,
            rgba(126,31,63,0.03) 35%,
            transparent 70%
        );
    transform: rotate(-8deg);
    pointer-events: none;
}

.application-header::after {
    content: "";
    position: absolute;
    top: -120px;
    right: 120px;
    width: 500px;
    height: 240px;
    border-radius: 50%;
    border: 1px solid rgba(126,31,63,0.08);
    transform: rotate(-8deg);
    pointer-events: none;
}

.application-header-left,
.application-header-right {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
}

.application-logo {
    height: 98px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(126,31,63,0.08));
}

.application-header-right {
    gap: 26px;
}

.application-user-email {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.application-header-divider {
    height: 4px;
    background: linear-gradient(90deg, #7E1F3F, #a51d4f, #7E1F3F);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(126,31,63,0.16);
}

/* =========================================
   BUTTONS
========================================= */

.secondary-btn,
.save-draft-btn,
.nav-btn,
.document-upload-btn,
.change-photo-btn {
    font-family: inherit;
}

.secondary-btn {
    padding: 13px 24px;
    border: 1px solid #7E1F3F;
    border-radius: 10px;
    background: #ffffff;
    color: #7E1F3F;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.secondary-btn:hover {
    background: #7E1F3F;
    color: #ffffff;
}

.save-draft-btn {
    height: 52px;
    padding: 0 22px;
    border: 1px solid rgba(126,31,63,0.45);
    border-radius: 14px;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #7E1F3F;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.save-draft-btn:hover {
    transform: translateY(-1px);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(126,31,63,0.12);
}

.save-draft-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* =========================================
   LAYOUT
========================================= */

.application-layout {
    flex: 1;
    display: flex;
    min-height: 0;
}

.application-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.application-content {
    padding: 56px 48px 80px;
}

.application-step-form {
    width: 100%;
}

/* =========================================
   SIDEBAR
========================================= */

.application-sidebar {
    width: 360px;
    min-width: 360px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e7e9ee;
}

.application-sidebar-inner {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 42px 30px;
}

.sidebar-progress {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-progress::before {
    content: "";
    position: absolute;
    top: 36px;
    bottom: 36px;
    left: 32px; /* padding-left(14) + step-number-width(36)/2 */
    width: 1px;
    background: #e6e9ef;
}

.sidebar-step {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 36px 30px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #2d3748;
    transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.sidebar-step:hover {
    background: rgba(126,31,63,0.045);
    transform: translateX(2px);
}

.sidebar-step.active {
    background: linear-gradient(
        90deg,
        rgba(126,31,63,0.10),
        rgba(126,31,63,0.03)
    );
}

.sidebar-step.locked {
    cursor: not-allowed;
}

.sidebar-step.locked:hover {
    transform: none;
    background: transparent;
}

/* Step number circle — always shows the step number */
.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eef1f5;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 2;
}

.step-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
}

.step-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
}

/* Label + badge stacked vertically */
.step-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #2d3748;
}

/* ---- Status badges ---- */
.step-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    width: fit-content;
    line-height: 1.6;
}

.step-status-badge svg {
    flex-shrink: 0;
}

.step-badge-completed {
    background: #dcfce7;
    color: #16a34a;
}

.step-badge-current {
    background: rgba(126,31,63,0.12);
    color: #7E1F3F;
}

.step-badge-available {
    background: #dbeafe;
    color: #1d4ed8;
}

.step-badge-locked {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Per-status: circle + icon colours */
.sidebar-step.active .step-number {
    background: #7E1F3F;
    color: #ffffff;
}

.sidebar-step.active .step-icon {
    color: #7E1F3F;
}

.sidebar-step.active .step-label {
    color: #7E1F3F;
    font-weight: 700;
}

.sidebar-step.completed .step-number {
    background: #dcfce7;
    color: #16a34a;
}

.sidebar-step.completed .step-icon {
    color: #16a34a;
}

.sidebar-step.available .step-number {
    background: #dbeafe;
    color: #1d4ed8;
}

.sidebar-step.available .step-icon {
    color: #1d4ed8;
}

.sidebar-step.locked .step-number {
    background: #f3f4f6;
    color: #9ca3af;
}

.sidebar-step.locked .step-icon {
    color: #d1d5db;
}

.sidebar-step.locked .step-label {
    color: #9ca3af;
}

/* ---- Navigation Guide card ---- */
.sidebar-nav-guide {
    margin-top: 28px;
    padding: 14px 16px;
    background: #f8f9fb;
    border-radius: 12px;
    border: 1px solid #e7e9ee;
}

.sidebar-nav-guide-title {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.sidebar-nav-guide-items {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.sidebar-nav-guide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

/* =========================================
   FORM CARD / TITLES
========================================= */

.form-card {
    width: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #fdfdfe 100%);
    border-radius: 24px;
    padding: 44px 52px;
    box-shadow: 0 12px 32px rgba(15,23,42,0.05);
    border: 1px solid #eef1f5;
}

.form-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 34px;
}

.form-title-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.form-title-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: rgba(126,31,63,0.08);
    color: #7E1F3F;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-title-icon svg {
    width: 34px;
    height: 34px;
    stroke-width: 2;
}

.form-card h1,
.form-title-row h1 {
    margin: 0 0 4px;
    font-size: 32px;
    font-weight: 650;
    letter-spacing: -0.3px;
    color: #111827;
}

.form-intro,
.form-title-row .form-intro {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #5b6472;
}

.form-intro-notice {
    margin: 10px 0 0 0;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #78350f;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    font-weight: 600;
}

/* =========================================
   FORM SECTIONS
========================================= */

.form-section {
    margin-top: 38px;
    padding-top: 30px;
    border-top: 1px solid #edf0f5;
}

.form-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.form-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #7E1F3F;
    margin-bottom: 6px;
}

.form-section-subtitle {
    font-size: 13px;
    color: #7b8190;
    margin-bottom: 24px;
}

/* =========================================
   GRID
========================================= */

.form-grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px 28px;
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* =========================================
   FORM GROUPS
========================================= */

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

.form-group label {
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.form-group label span {
    color: #b00035;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    background: #ffffff;
    font-size: 13px;
    color: #111827;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
    height: 120px;
    padding-top: 14px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.document-remarks textarea:focus {
    outline: none;
    border-color: #7E1F3F;
    box-shadow: 0 0 0 4px rgba(126,31,63,0.08);
}

.form-group select {
    appearance: none;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

/* =========================================
   ADDRESS PANELS
========================================= */

.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.address-panel {
    border: 1px solid #f1dfe6;
    border-radius: 18px;
    padding: 26px;
    background: #fff7fa;
}

.address-panel.full-width {
    grid-column: span 2;
}

.address-panel-title {
    font-size: 17px;
    font-weight: 700;
    color: #7E1F3F;
    margin-bottom: 4px;
}

.address-panel-subtitle {
    font-size: 12px;
    color: #7b8190;
    margin-bottom: 18px;
}

.address-panel .form-group + .form-group {
    margin-top: 16px;
}

.address-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.address-panel .full-address {
    grid-column: span 2;
}

/* =========================================
   PHOTO UPLOAD
========================================= */

.photo-upload-card,
.uploaded-photo-preview {
    width: 150px;
    height: 190px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.photo-upload-card {
    border: 1px dashed rgba(126,31,63,0.35);
    background: #fff7fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.photo-upload-card:hover {
    border-color: #7E1F3F;
    background: #fff1f6;
    transform: translateY(-1px);
}

.photo-upload-card img,
.uploaded-photo-preview img,
.photo-preview-filled img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-empty,
.uploaded-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-preview-empty {
    flex-direction: column;
    padding: 10px;
    text-align: center;
    color: #7E1F3F;
}

.photo-preview-filled {
    width: 100%;
    height: 100%;
}

.photo-upload-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(126,31,63,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    font-weight: 400;
}

.photo-upload-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.photo-upload-text {
    font-size: 13px;
    font-weight: 600;
}

.photo-upload-note {
    font-size: 12px;
    color: #8a6674;
    margin-top: 6px;
}

/* =========================================
   PHOTO MODAL
========================================= */

.photo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.photo-modal-overlay.active {
    display: flex;
}

.photo-modal {
    width: 460px;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15,23,42,0.18);
}

.photo-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #ececec;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.photo-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 650;
    color: #111827;
}

.photo-modal-close {
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}

.photo-modal-body {
    padding: 28px;
}

.photo-instruction-box {
    background: #fff7fa;
    border: 1px solid #f2dce5;
    border-radius: 18px;
    padding: 20px;
}

.photo-instruction-title {
    font-size: 16px;
    font-weight: 700;
    color: #7E1F3F;
    margin-bottom: 12px;
}

.photo-instructions {
    margin: 0;
    padding-left: 18px;
    color: #555;
    line-height: 1.8;
}

.photo-dropzone {
    margin-top: 24px;
    height: 170px;
    border: 2px dashed rgba(126,31,63,0.25);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff9fb 0%, #fff4f7 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.photo-dropzone:hover,
.photo-dropzone.dragging {
    border-color: #7E1F3F;
    background: #ffeef3;
}

.photo-dropzone-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(126,31,63,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #7E1F3F;
    margin-bottom: 14px;
}

.photo-dropzone-title {
    font-size: 18px;
    font-weight: 700;
    color: #7E1F3F;
    margin-bottom: 4px;
}

.photo-dropzone-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.photo-dropzone-format {
    font-size: 12px;
    color: #8b7280;
}

/* =========================================
   UPLOADED PHOTO CARD
========================================= */

.uploaded-photo-card {
    margin: 28px 0 40px;
    padding: 22px;
    border: 1px solid #eadde3;
    border-radius: 20px;
    background: #fffafa;
}

.uploaded-photo-left,
.uploaded-photo-title-row {
    display: flex;
    align-items: center;
}

.uploaded-photo-left {
    gap: 22px;
}

.uploaded-photo-title-row {
    gap: 12px;
    margin-bottom: 10px;
}

.uploaded-photo-preview {
    background: #f3f4f6;
}

.uploaded-photo-placeholder {
    font-size: 13px;
    color: #777;
    text-align: center;
}

.uploaded-photo-content {
    flex: 1;
}

.uploaded-photo-title {
    font-size: 22px;
    font-weight: 650;
    color: #111827;
}

.uploaded-photo-description {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

.photo-status-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
}

.change-photo-btn {
    display: block;
    height: 42px;
    padding: 0 18px;
    border: 1px solid #7E1F3F;
    border-radius: 12px;
    background: #ffffff;
    color: #7E1F3F;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

/* =========================================
   DOCUMENT UPLOADS
========================================= */

.document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}

.document-card {
    min-height: 170px;
    padding: 24px;
    border: 1px solid #eadde3;
    border-radius: 18px;
    background: #ffffff;
}

.document-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.document-title {
    font-size: 18px;
    font-weight: 650;
    color: #111827;
}

.document-subtitle,
.document-status {
    font-size: 12px;
    color: #7b8190;
}

.document-subtitle {
    margin-bottom: 10px;
}

.document-upload-area {
    margin-top: 22px;
}

.document-status,
.document-actions {
    margin-top: 14px;
}

.document-upload-btn {
    height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: #7E1F3F;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.document-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.document-action-link {
    border: 0;
    background: none;
    color: #7E1F3F;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.document-remarks {
    margin-top: 16px;
}

.document-remarks label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.document-remarks textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px 12px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    resize: vertical;
    font-size: 13px;
    font-family: inherit;
}

/* =========================================
   NAVIGATION BUTTONS
========================================= */

.step-navigation {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 32px;
}

.nav-btn {
    min-width: 150px;
    height: 54px;
    padding: 0 24px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-btn:hover {
    transform: translateY(-1px);
}

.primary-nav {
    border: 1px solid #7E1F3F;
    background: #7E1F3F;
    color: #ffffff;
}

.secondary-nav {
    border: 1px solid #7E1F3F;
    background: #ffffff;
    color: #7E1F3F;
}

/* =========================================
   FOOTER
========================================= */

.application-footer {
    height: 72px;
    background: linear-gradient(90deg, #7E1F3F, #8e2447);
    color: #ffffff;
    padding: 0 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(15,23,42,0.05);
}

.application-footer-links {
    display: flex;
    align-items: center;
    gap: 22px;
}

.application-footer-links a {
    color: #ffffff;
    text-decoration: none;
}

/* =========================================
   UTILITIES
========================================= */

.required-text {
    color: #7E1F3F;
    font-weight: 700;
}

.applicant-category-group {
    max-width: 520px;
}

.small-note {
    font-size: 13px;
    line-height: 1.7;
    color: #5b6472;
    margin-bottom: 16px;
}

.hidden {
    display: none;
}

/* (Sidebar visibility tweaks removed — consolidated into the main SIDEBAR section above) */

/* =========================================
   APPLICANT CATEGORY
========================================= */

.applicant-category-group {
    max-width: none;
}

.applicant-category-group label {
    display: block;
    font-size: 20px;
    font-weight: 650;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 14px;
}

.applicant-category-group select {
    height: 54px;
    font-size: 16px;
    font-weight: 500;
}

.applicant-category-group {
    max-width: 600px;
}

.applicant-category-group select {
    width: 100%;
    max-width: 600px;
}

/* =========================================
   REQUIRED VS OPTIONAL DOCUMENTS
========================================= */

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.required-documents-section .form-section-title {
    color: #7E1F3F;
}

.optional-documents-section {
    background: #fafafa;
    border-radius: 20px;
    padding: 24px;
}

.optional-documents-section .form-section-title {
    color: #374151;
}

.optional-documents-section .document-card {
    background: #fafbfc;
    border: 1px solid #e5e7eb;
}

.optional-documents-section .document-title {
    color: #374151;
}

/* Keep TMC button */
.optional-documents-section .document-upload-btn {
    background: #7E1F3F;
}

/* Keep TMC download link */
.optional-documents-section .document-action-link {
    color: #7E1F3F;
}

.optional-label {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 700;
}

.document-error-alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 14px 18px;
    color: #991b1b;
    font-size: 13px;
}

.document-error-alert strong {
    display: block;
    margin-bottom: 8px;
}

.document-error-alert ul {
    margin: 0;
    padding-left: 18px;
}

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

/* =========================================
   FAMILY / GUARDIAN
   All rules scoped under .family-guardian-page
   — no global classes modified here.
========================================= */

/* Error alert */
.family-guardian-page .family-error-alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 14px 18px;
    color: #991b1b;
    font-size: 13px;
    margin-bottom: 20px;
}

.family-guardian-page .family-error-alert strong {
    display: block;
    margin-bottom: 8px;
}

.family-guardian-page .family-error-alert ul {
    margin: 0;
    padding-left: 18px;
}

.family-guardian-page .family-error-alert li {
    margin-bottom: 4px;
}

/* Section spacing — slightly more breathing room than global default */
.family-guardian-page .form-section {
    margin-top: 48px;
    padding-top: 36px;
}

/* Yes / No button selector */
.family-guardian-page .family-yes-no-group {
    margin-bottom: 0;
}

.family-guardian-page .yes-no-buttons {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.family-guardian-page .yes-no-btn {
    min-width: 100px;
    height: 46px;
    padding: 0 28px;
    border: 1.5px solid #7E1F3F;
    border-radius: 10px;
    background: #ffffff;
    color: #7E1F3F;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.family-guardian-page .yes-no-btn:hover:not(.yes-no-btn--selected) {
    background: rgba(126, 31, 63, 0.06);
}

.family-guardian-page .yes-no-btn--selected {
    background: #7E1F3F;
    color: #ffffff;
}

/* Sub-section shown on Yes */
.family-guardian-page .family-subsection {
    margin-top: 20px;
}

/* Table wrapper — horizontally scrollable */
.family-guardian-page .family-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: 10px;
    border: 1px solid #d7dce3;
}

/* Table */
.family-guardian-page .family-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    font-size: 13px;
    color: #111827;
    background: #fff;
    font-family: inherit;
}

.family-guardian-page .family-table thead {
    background: #f8f9fb;
    border-bottom: 1px solid #d7dce3;
}

.family-guardian-page .family-table th {
    padding: 12px 13px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}

.family-guardian-page .family-table th.required-col::after {
    content: " *";
    color: #7E1F3F;
}

.family-guardian-page .family-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f5;
    vertical-align: middle;
}

.family-guardian-page .family-table tr:last-child td {
    border-bottom: none;
}

.family-guardian-page .family-table tbody tr:hover td {
    background: #fafbfc;
}

/* S/N column */
.family-guardian-page .family-sn {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    width: 44px;
}

/* Text / date inputs inside table rows */
.family-guardian-page .family-input {
    width: 100%;
    min-width: 120px;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.family-guardian-page .family-input:focus {
    border-color: #7E1F3F;
    box-shadow: 0 0 0 4px rgba(126, 31, 63, 0.08);
}

/* Select inputs inside table rows */
.family-guardian-page .family-select {
    width: 100%;
    min-width: 130px;
    height: 44px;
    padding: 0 32px 0 13px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position:
        calc(100% - 14px) 50%,
        calc(100% - 8px)  50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.family-guardian-page .family-select:focus {
    border-color: #7E1F3F;
    box-shadow: 0 0 0 4px rgba(126, 31, 63, 0.08);
}

/* Remove row button */
.family-guardian-page .family-remove-btn {
    height: 38px;
    padding: 0 14px;
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.family-guardian-page .family-remove-btn:hover {
    background: #fef2f2;
}

.family-guardian-page .family-remove-btn:disabled {
    color: #9ca3af;
    border-color: #e5e7eb;
    background: #f9fafb;
    cursor: not-allowed;
}

/* Checkbox column inside table */
.family-guardian-page .family-checkbox-cell {
    text-align: center;
    width: 56px;
}

.family-guardian-page .family-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #7E1F3F;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

/* Move-up / Move-down buttons */
.family-guardian-page .family-row-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
}

.family-guardian-page .family-move-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.family-guardian-page .family-move-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.family-guardian-page .family-move-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Add row button — maroon outline, matches portal secondary button style */
.family-guardian-page .add-row-btn {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 20px;
    background: #fff;
    color: #7E1F3F;
    border: 1.5px solid #7E1F3F;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.family-guardian-page .add-row-btn:hover {
    background: #7E1F3F;
    color: #fff;
}

/* =========================================
   STUDENT PASS — ANTECEDENT QUESTIONS
========================================= */

.family-guardian-page .antecedent-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
}

.family-guardian-page .antecedent-question {
    padding: 18px 20px;
    border-bottom: 1px solid #edf0f5;
    background: #fff;
}

.family-guardian-page .antecedent-question:last-child {
    border-bottom: none;
}

.family-guardian-page .antecedent-q-text {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.5;
}

.family-guardian-page .antecedent-q-text span {
    color: #b00035;
}

.family-guardian-page .antecedent-explanation {
    margin-top: 14px;
    padding-left: 2px;
}

.family-guardian-page .antecedent-explanation label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}

.family-guardian-page .antecedent-explanation label span {
    color: #b00035;
}

.family-guardian-page .antecedent-textarea {
    width: 100%;
    max-width: 640px;
    min-height: 80px;
    padding: 10px 13px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.family-guardian-page .antecedent-textarea:focus {
    outline: none;
    border-color: #7E1F3F;
    box-shadow: 0 0 0 4px rgba(126, 31, 63, 0.08);
}

/* =========================================
   STUDENT PASS — FINANCIAL SUPPORT TABLE
========================================= */

.family-guardian-page .fin-table-wrapper {
    margin-top: 16px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    overflow: hidden;
}

.family-guardian-page .fin-support-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

.family-guardian-page .fin-support-table th {
    padding: 11px 14px;
    background: #f8f9fb;
    border-bottom: 1px solid #d7dce3;
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    white-space: nowrap;
}

.family-guardian-page .fin-support-table th:first-child {
    text-align: left;
    min-width: 280px;
    white-space: normal;
}

.family-guardian-page .fin-support-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf0f5;
    border-right: 1px solid #edf0f5;
    vertical-align: middle;
}

.family-guardian-page .fin-support-table td:last-child {
    border-right: none;
}

.family-guardian-page .fin-support-table td:first-child {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    padding-left: 14px;
    background: #f8f9fb;
}

.family-guardian-page .fin-support-table tr:last-child td {
    border-bottom: none;
}

.family-guardian-page .fin-input {
    width: 100%;
    min-width: 110px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.family-guardian-page .fin-input:focus {
    border-color: #7E1F3F;
    box-shadow: 0 0 0 4px rgba(126, 31, 63, 0.08);
}

/* =========================================
   STUDENT PASS — SUB-SECTION TITLES (4A, 4B…)
========================================= */

.family-guardian-page .sp-subsection-title {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    margin: 28px 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf0f5;
}

/* =========================================
   RESPONSIVE BREAKPOINTS
   768px  = tablet minimum
   1024px = laptop minimum
   1400px = desktop minimum
   < 768px = phones — blocked, not supported
========================================= */

/* ── Mobile block — hidden by default (inline style="display:none" on the el).
      The !important in the media query below overrides the inline style.      ── */

/* ── Below 768px: hide app/welcome layouts, show mobile block ── */
@media (max-width: 767px) {
    .application-page  { display: none !important; }
    .welcome-layout    { display: none !important; }
    .mobile-block {
        display: flex !important;
        min-height: 100vh;
        align-items: center;
        justify-content: center;
        background: #f4f7fb;
        padding: 32px 20px;
        box-sizing: border-box;
    }
}

/* ── Toggle button — hidden on desktop/laptop, shown on tablet only ── */
.sidebar-toggle-btn { display: none; }

/* ── Tablet (768px – 1023px) ──
      Collapsed strip by default; toggle expands to full sidebar
========================================= */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Header */
    .application-header { height: 80px; padding: 0 20px; }
    .application-logo { height: 58px; }
    .save-draft-btn { height: 40px; padding: 0 14px; font-size: 12px; gap: 7px; }
    .save-draft-btn svg { width: 16px; height: 16px; }
    .application-user-email { font-size: 12px; }

    /* ── Toggle button ── */
    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        flex-shrink: 0;
        margin-bottom: 14px;
        color: #374151;
        transition: background 0.15s, border-color 0.15s;
    }
    .sidebar-toggle-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
    .sidebar-toggle-icon-open  { display: block; }
    .sidebar-toggle-icon-close { display: none; }

    /* ── COLLAPSED (default) ── */
    .application-sidebar {
        width: 68px;
        min-width: 68px;
        overflow: hidden;
        transition: width 0.25s ease, min-width 0.25s ease;
    }
    .application-sidebar-inner {
        padding: 20px 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .sidebar-progress { gap: 6px; width: 100%; align-items: center; }
    .sidebar-progress::before {
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
    }
    .sidebar-step {
        display: flex;
        justify-content: center;
        align-items: center;
        grid-template-columns: unset;
        gap: 0;
        padding: 6px 0;
        border-radius: 10px;
        width: 100%;
    }
    .sidebar-step:hover { transform: none; background: transparent; }
    .sidebar-step.active { background: transparent; }
    .step-icon { display: none; }
    .step-info { display: none; }
    .step-number { width: 36px; height: 36px; font-size: 13px; z-index: 2; position: relative; flex-shrink: 0; }
    .sidebar-step.active .step-number { box-shadow: 0 0 0 3px rgba(126,31,63,0.22); }
    .sidebar-nav-guide { display: none; }

    /* ── EXPANDED state (toggled via JS) ── */
    .application-sidebar.sidebar-expanded {
        width: 280px;
        min-width: 280px;
    }
    .application-sidebar.sidebar-expanded .application-sidebar-inner {
        padding: 24px 18px;
        align-items: stretch;
    }
    .application-sidebar.sidebar-expanded .sidebar-toggle-icon-open  { display: none; }
    .application-sidebar.sidebar-expanded .sidebar-toggle-icon-close { display: block; }
    .application-sidebar.sidebar-expanded .sidebar-progress {
        gap: 4px;
        align-items: stretch;
    }
    .application-sidebar.sidebar-expanded .sidebar-progress::before {
        left: 26px; /* padding-left(10) + step-number-width(32)/2 */
        transform: none;
        width: 2px;
    }
    .application-sidebar.sidebar-expanded .sidebar-step {
        display: grid;
        grid-template-columns: 36px 26px minmax(0,1fr);
        gap: 10px;
        padding: 9px 10px;
        justify-content: unset;
        align-items: center;
    }
    .application-sidebar.sidebar-expanded .sidebar-step:hover {
        transform: translateX(2px);
        background: rgba(126,31,63,0.04);
    }
    .application-sidebar.sidebar-expanded .sidebar-step.active {
        background: rgba(126,31,63,0.07);
    }
    .application-sidebar.sidebar-expanded .step-icon  { display: flex; width: 26px; height: 26px; }
    .application-sidebar.sidebar-expanded .step-icon svg { width: 17px; height: 17px; }
    .application-sidebar.sidebar-expanded .step-info  { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .application-sidebar.sidebar-expanded .step-number { width: 32px; height: 32px; font-size: 12px; box-shadow: none; }
    .application-sidebar.sidebar-expanded .sidebar-step.active .step-number { box-shadow: none; }
    .application-sidebar.sidebar-expanded .step-label { font-size: 11.5px; }
    .application-sidebar.sidebar-expanded .step-status-badge { font-size: 10px; }

    /* Main content */
    .application-content { padding: 24px 20px 48px; }
    .form-card { padding: 24px 24px; border-radius: 16px; }
    .form-card h1, .form-title-row h1 { font-size: 22px; }
    .form-title-icon { width: 44px; height: 44px; border-radius: 12px; }
    .form-title-icon svg { width: 26px; height: 26px; }
    .form-title-row { gap: 16px; margin-bottom: 24px; }
    .form-section-title { font-size: 18px; }
    .form-section { margin-top: 28px; padding-top: 22px; }
    .form-grid-12 { gap: 12px 16px; }

    .col-3 { grid-column: span 6; }
    .col-4 { grid-column: span 6; }
    .col-5 { grid-column: span 6; }

    .address-grid { gap: 14px; }
    .address-panel { padding: 16px 18px; }

    .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .document-card { min-height: 140px; padding: 16px; }
    .document-title { font-size: 14px; }

    .nav-btn { min-width: 110px; height: 46px; font-size: 13px; }
    .step-navigation { gap: 12px; margin-top: 20px; }

    .application-footer { height: 52px; padding: 0 20px; font-size: 11px; }
    .application-footer-links { gap: 14px; }

    .photo-modal { width: min(92vw, 420px); }
}

/* ── Laptop (1024px – 1399px) ──
      Narrow sidebar (220px) with labels but no icons/badges
========================================= */
@media (min-width: 1024px) and (max-width: 1399px) {

    /* Sidebar — compact labelled */
    .application-sidebar {
        width: 220px;
        min-width: 220px;
    }
    .application-sidebar-inner {
        padding: 28px 14px;
    }
    .sidebar-step {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 10px;
        border-radius: 10px;
    }
    .sidebar-progress { gap: 4px; }
    .sidebar-progress::before { left: 24px; } /* padding-left(10) + step-number-width(28)/2 */
    /* Hide icon column — just number + label */
    .step-icon { display: none; }
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .step-label { font-size: 11px; }
    .step-status-badge {
        font-size: 10px;
        padding: 1px 5px;
    }
    .sidebar-nav-guide { display: none; }

    /* Main content */
    .application-content {
        padding: 40px 36px 68px;
    }
    .form-card {
        padding: 36px 40px;
    }
    .form-card h1,
    .form-title-row h1 {
        font-size: 28px;
    }

    /* Document grid — 2 columns */
    .document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    /* Collapse col-3 on laptop */
    .col-3 { grid-column: span 4; }
}