/* ==========================================
   StudentMitraa responsive service workflows
   Shared by College Search and Career Guidance
   ========================================== */

/* Theme tokens: keep both service pages consistent in light and dark mode. */
:root {
    color-scheme: light;
    --flow-page: #f4f7fb;
    --flow-surface: #ffffff;
    --flow-surface-soft: #eef4ff;
    --flow-text: #142033;
    --flow-muted: #65728a;
    --flow-line: #dce4ef;
    --flow-brand: #2563eb;
    --flow-brand-strong: #1d4ed8;
    --flow-accent: #f97316;
    --flow-success: #16845b;
    --flow-danger: #c2413b;
    --flow-shadow: 0 18px 48px rgba(35, 57, 91, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --flow-page: #07111f;
        --flow-surface: #0e1c30;
        --flow-surface-soft: #142641;
        --flow-text: #f1f5fb;
        --flow-muted: #9caac0;
        --flow-line: #243650;
        --flow-brand: #65a1ff;
        --flow-brand-strong: #8db8ff;
        --flow-accent: #fb923c;
        --flow-success: #66d6a9;
        --flow-danger: #ff938d;
        --flow-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    }
}

/* Page foundation: provide predictable sizing, typography, and keyboard behavior. */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--flow-page);
    color: var(--flow-text);
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

/* Shared header: keep home navigation visible on phone and desktop. */
.flow-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 max(20px, calc((100% - 1180px) / 2));
    background: color-mix(in srgb, var(--flow-surface) 94%, transparent);
    border-bottom: 1px solid var(--flow-line);
    backdrop-filter: blur(16px);
}

.flow-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--flow-text);
    font-weight: 700;
}

.flow-brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
}

.flow-brand strong {
    color: var(--flow-accent);
}

.flow-back-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--flow-line);
    border-radius: 11px;
    background: var(--flow-surface-soft);
    color: var(--flow-text);
    font-size: 13px;
    font-weight: 700;
}

/* Main page shell: center service content without restricting small screens. */
.flow-page-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 46px 0 80px;
}

/* Service hero: introduce each workflow without a separate numbered summary panel. */
.flow-hero {
    margin-bottom: 28px;
}

.flow-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 12px;
    color: var(--flow-brand-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flow-hero h1 {
    max-width: 760px;
    margin: 0 0 14px;
    color: var(--flow-text);
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.flow-hero-copy>p:last-child {
    max-width: 690px;
    margin: 0;
    color: var(--flow-muted);
    font-size: 16px;
    line-height: 1.75;
}

/* Main form surface: contain the active service step and its status. */
.flow-panel {
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid var(--flow-line);
    border-radius: 22px;
    background: var(--flow-surface);
    box-shadow: var(--flow-shadow);
}

.flow-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.flow-panel-head h2 {
    margin: 0 0 7px;
    color: var(--flow-text);
    font-size: clamp(23px, 3vw, 31px);
}

.flow-panel-head p {
    margin: 0;
    color: var(--flow-muted);
    line-height: 1.6;
}

.flow-step-badge {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 99px;
    background: var(--flow-surface-soft);
    color: var(--flow-brand-strong);
    font-size: 11px;
    font-weight: 700;
}

/* Form grid: use two columns on wider screens and one on phones. */
.flow-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.flow-field {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.flow-field-wide,
.flow-actions,
.flow-form-status {
    grid-column: 1 / -1;
}

.flow-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--flow-text);
    font-size: 13px;
    font-weight: 700;
}

.flow-label-number {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--flow-surface-soft);
    color: var(--flow-brand-strong);
    font-size: 10px;
}

.flow-input,
.flow-select {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid var(--flow-line);
    border-radius: 12px;
    outline: 0;
    background: var(--flow-page);
    color: var(--flow-text);
}

.flow-input:focus,
.flow-select:focus {
    border-color: var(--flow-brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--flow-brand) 18%, transparent);
}

.flow-input:disabled,
.flow-select:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.flow-help {
    color: var(--flow-muted);
    font-size: 11px;
    line-height: 1.5;
}

/* Form actions: provide one clear primary action and a safe back action. */
.flow-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.flow-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid var(--flow-line);
    border-radius: 12px;
    background: var(--flow-surface-soft);
    color: var(--flow-text);
    font-weight: 700;
}

.flow-button-primary {
    border-color: var(--flow-brand-strong);
    background: var(--flow-brand-strong);
    color: #ffffff;
}

.flow-button-accent {
    border-color: var(--flow-accent);
    background: var(--flow-accent);
    color: #ffffff;
}

.flow-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.flow-form-status {
    min-height: 20px;
    margin: 0;
    color: var(--flow-muted);
    font-size: 12px;
}

.flow-form-status.is-error {
    color: var(--flow-danger);
}

.flow-form-status.is-success {
    color: var(--flow-success);
}

/* College results: present matching colleges as responsive cards. */
.flow-results {
    margin-top: 28px;
}

.flow-results-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.flow-results-head h2 {
    margin: 0 0 5px;
    font-size: 25px;
}

.flow-results-head p {
    margin: 0;
    color: var(--flow-muted);
}

.flow-results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.flow-result-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--flow-line);
    border-radius: 18px;
    background: var(--flow-surface);
    box-shadow: var(--flow-shadow);
}

.flow-result-card img {
    width: 100%;
    height: 170px;
    display: block;
    object-fit: cover;
    background: var(--flow-surface-soft);
}

.flow-result-body {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.flow-result-body h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
}

.flow-result-meta,
.flow-result-course {
    margin: 0;
    color: var(--flow-muted);
    font-size: 12px;
    line-height: 1.55;
}

.flow-result-meta {
    display: flex;
    align-items: center;
    gap: 7px;
}

.flow-fit-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--flow-success) 12%, transparent);
    color: var(--flow-success);
    font-size: 10px;
    font-weight: 700;
}

.flow-result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.flow-result-fee {
    color: var(--flow-text);
    font-size: 13px;
    font-weight: 700;
}

.flow-result-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--flow-brand-strong);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.flow-empty-state {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 220px;
    padding: 28px;
    border: 1px dashed var(--flow-line);
    border-radius: 18px;
    background: var(--flow-surface);
    color: var(--flow-muted);
    text-align: center;
}

.flow-empty-state i {
    color: var(--flow-brand-strong);
    font-size: 28px;
}

.flow-empty-state h3,
.flow-empty-state p {
    margin: 0;
}

/* Guidance type preview: explain the two conditional paths. */
.guidance-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.guidance-choice-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--flow-line);
    border-radius: 12px;
    background: var(--flow-surface-soft);
    color: var(--flow-muted);
    font-size: 12px;
    line-height: 1.55;
}

.guidance-choice-note i {
    margin-top: 2px;
    color: var(--flow-brand-strong);
}

/* Booking confirmation: show only non-sensitive request details. */
.flow-confirmation {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.flow-confirmation-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--flow-success) 15%, transparent);
    color: var(--flow-success);
    font-size: 29px;
}

.flow-confirmation h2 {
    margin: 0 0 10px;
    font-size: 29px;
}

.flow-confirmation>p {
    margin: 0 auto;
    color: var(--flow-muted);
    line-height: 1.65;
}

.flow-confirmation-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 24px 0;
    text-align: left;
}

.flow-confirmation-summary div {
    padding: 14px;
    border-radius: 11px;
    background: var(--flow-surface-soft);
}

.flow-confirmation-summary small,
.flow-confirmation-summary strong {
    display: block;
}

.flow-confirmation-summary small {
    margin-bottom: 4px;
    color: var(--flow-muted);
}

/* Shared footer: provide quick navigation without duplicating the full homepage footer. */
.flow-footer {
    padding: 25px 20px;
    border-top: 1px solid var(--flow-line);
    background: var(--flow-surface);
    color: var(--flow-muted);
    text-align: center;
    font-size: 12px;
}

.flow-footer a {
    color: var(--flow-brand-strong);
    font-weight: 700;
}

/* Tablet layout: reduce college results to two columns. */
@media (max-width: 900px) {
    .flow-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phone layout: stack fields, actions, results, and confirmation details. */
@media (max-width: 640px) {
    .flow-topbar {
        height: 60px;
        padding: 0 12px;
    }

    .flow-brand img {
        width: 38px;
        height: 38px;
    }

    .flow-brand>span,
    .flow-back-link span {
        display: none;
    }

    .flow-back-link {
        width: 42px;
        padding: 0;
    }

    .flow-page-shell {
        width: calc(100% - 24px);
        padding: 30px 0 56px;
    }

    .flow-hero {
        gap: 20px;
        margin-bottom: 20px;
    }

    .flow-hero h1 {
        font-size: clamp(30px, 10vw, 42px);
    }

    .flow-panel {
        padding: 20px 15px;
        border-radius: 17px;
    }

    .flow-panel-head {
        display: grid;
        gap: 10px;
    }

    .flow-step-badge {
        width: fit-content;
        grid-row: 1;
    }

    .flow-form-grid,
    .guidance-choice-grid,
    .flow-confirmation-summary,
    .flow-results-grid {
        grid-template-columns: 1fr;
    }

    .flow-field-wide,
    .flow-actions,
    .flow-form-status {
        grid-column: 1;
    }

    .flow-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .flow-button {
        width: 100%;
    }

    .flow-results-head {
        display: block;
    }

    .flow-results-head .flow-button {
        margin-top: 12px;
    }

    .flow-result-card img {
        height: 190px;
    }
}

/* Reduced motion: respect operating-system accessibility preferences. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
