/* ---------------------------------------------------------------------------
   myUNUD — six-step application form
   ---------------------------------------------------------------------------
   Self-contained: this file replaces Bootstrap 3 for /application only. The
   three other templates that still load bootstrap.css (maintenance,
   AttendancePublic/fill, Document/public_download) pull it in themselves and
   are untouched.

   The look is GoBali Duotone, the same as gobali.org and the myUNUD admin:

     charcoal        #383939      text, links, dark fills
     ink             #2b2c2c      headings
     lime            #d0ff00      fills only — buttons, badges, highlights —
                                  always with Charcoal text, never as text or
                                  a thin line on white
     mist            #f3f4f0      page background, behind a white form card
     lines           #dfe0da      inputs a step darker, #c9caca
     muted text      #77786f
     error           #a94442 on #f2dede, border #ebccd1
     type            Open Sans, 400 body / 700 headings
     shapes          cards round one corner (0 24px 0 0); buttons are a
                     "petal" (0 999px 999px 999px, square top-left)

   Layout is flex/grid rather than a 12-column float grid. There is no build
   step in this repo, so this file is written to be edited by hand — hence
   plain class names, no nesting deeper than two levels, and no custom
   properties beyond the palette.
   ------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin-ext');

:root {
    --charcoal: #383939;
    --ink: #2b2c2c;
    --lime: #d0ff00;
    --lime-pale: #efffb0;
    --mist: #f3f4f0;
    --border: #dfe0da;
    --input-border: #c9caca;
    --muted: #77786f;
    --petal: 0 999px 999px 999px;
    --card: 0 24px 0 0;
    --error: #a94442;
    --error-bg: #f2dede;
    --error-border: #ebccd1;
    --text: #383939;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--mist);
}

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

a:hover {
    color: #000;
}

h1 {
    font-size: 44px;
    line-height: 1.1;
    margin: 0 0 30px;
    font-weight: 700;
    color: var(--ink);
}

h2 {
    display: flex;
    align-items: center;
    font-size: 24px;
    padding-bottom: 20px;
    margin: 0 0 30px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--ink);
}

/* The step icon sits on a Lime petal: Lime is a fill, never a glyph colour.
   `i[class]` so it outranks Font Awesome's own `.fal { display: inline-block }`. */
h2 i[class] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-right: 14px;
    border-radius: var(--petal);
    background: var(--lime);
    color: var(--charcoal);
    font-size: 18px;
}

h3 {
    font-size: 18px;
    margin: 0 0 15px;
    font-weight: 700;
    color: var(--ink);
}

/* A section heading after other content starts a new section, so it needs
   air above it — without this it sits flush on the block before it. */
* + h3 {
    margin-top: 35px;
}

/* The same for the section titles that split a step, like Guarantor and
   Preferences on step 5. */
* + h2 {
    margin-top: 45px;
}

/* --- page shell --------------------------------------------------------- */

.page-header {
    padding: 18px 20px;
    margin-bottom: 40px;
    background: var(--charcoal);
}

.page-header a {
    display: inline-block;
}

.page-header img {
    display: block;
    height: 30px;
}

/* The form itself is a white card on the Mist page. */
.container > form {
    background: #fff;
    border-radius: var(--card);
    padding: 35px 40px 0;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .page-header {
        margin-bottom: 25px;
    }

    .page-header img {
        height: 24px;
    }

    h1 {
        font-size: 32px;
    }

    .container > form {
        padding: 25px 18px 0;
    }
}

.container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 15px;
}

.vertical-space {
    height: 40px;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

/* --- progress bar ------------------------------------------------------- */

.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 40px;
    padding: 0;
    border-bottom: 1px solid var(--input-border);
}

.wizard-step {
    flex: 1 1 0;
    min-width: 120px;
    text-align: center;
    padding: 12px 6px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-size: 13px;
}

.wizard-step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 6px;
    border-radius: var(--petal);
    border: 1px solid var(--input-border);
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.wizard-step--done {
    color: var(--text);
}

.wizard-step--done .wizard-step__number {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: #fff;
}

.wizard-step--current {
    color: var(--ink);
    border-bottom-color: var(--charcoal);
    font-weight: 700;
}

.wizard-step--current .wizard-step__number {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--charcoal);
}

.wizard-step a {
    color: inherit;
    text-decoration: none;
}

.wizard-step a:hover {
    text-decoration: underline;
}

/* --- form layout -------------------------------------------------------- */

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

.form-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.form-row--full {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.form-row {
    margin-bottom: 18px;
}

.form-row > label,
.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* A checkbox row's label is the whole control, box and text side by side;
   the rule above would make it a block and drop the gap `.choice` sets. */
.form-row > label.choice {
    display: flex;
    margin-bottom: 0;
    font-weight: 400;
}

.form-row--check {
    margin-bottom: 10px;
}

.form-row .required::after {
    content: ' *';
    color: var(--muted);
}

.form-control,
.form-row input[type='text'],
.form-row input[type='email'],
.form-row input[type='tel'],
.form-row input[type='date'],
.form-row input[type='number'],
.form-row select,
.form-row textarea {
    display: block;
    width: 100%;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--input-border);
    border-radius: 0;
    box-shadow: none;
}

.form-row textarea {
    min-height: 100px;
    resize: vertical;
}

.form-control:focus,
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--charcoal);
    outline: 0;
    box-shadow: 0 0 0 1px var(--charcoal);
}

.form-help {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

/* Phone: the country select and the number share one line. */
.form-phone {
    display: flex;
}

.form-phone select {
    width: 40%;
    flex: 0 0 40%;
}

.form-phone input {
    width: 60%;
    flex: 1 1 60%;
    border-left: none !important;
}

/* --- choices ------------------------------------------------------------ */

.choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-bottom: 18px;
}

.choice-list--stacked {
    flex-direction: column;
    gap: 6px;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.choice input {
    margin: 3px 0 0;
    flex: 0 0 auto;
    accent-color: var(--charcoal);
}

.choice--card {
    border-left: 3px solid var(--border);
    padding: 6px 15px;
    flex: 1 1 220px;
}

.choice--card:hover {
    border-left-color: var(--input-border);
    background: var(--mist);
}

.choice--card.is-selected {
    border-left-color: var(--charcoal);
    background: var(--lime-pale);
}

.choice__meta {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

/* --- errors and flashes ------------------------------------------------- */

.alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-danger {
    color: var(--error);
    background: var(--error-bg);
    border-color: var(--error-border);
}

.alert-info {
    color: #31708f;
    background: #d9edf7;
    border-color: #bce8f1;
}

.field-errors {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    color: var(--error);
    font-size: 12px;
}

.field-success {
    margin: 4px 0 0;
    color: var(--charcoal);
    font-weight: 600;
    font-size: 12px;
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: var(--error);
}

/* --- buttons ------------------------------------------------------------ */

.btn {
    display: inline-block;
    padding: 10px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--petal);
    cursor: pointer;
    background: none;
}

.btn-primary {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--charcoal);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: var(--lime);
}

.btn-secondary {
    background: #fff;
    border-color: var(--input-border);
    color: var(--charcoal);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--mist);
    border-color: var(--charcoal);
    color: var(--charcoal);
}

.btn-link {
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--charcoal);
    font-weight: 400;
    text-decoration: underline;
    font-size: 13px;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 30px 0 50px;
    border-top: 1px solid var(--border);
    margin-top: 30px;
}

.step-actions__spacer {
    flex: 1 1 auto;
}

/* --- price panel -------------------------------------------------------- */

.price-panel {
    border: 1px solid var(--border);
    border-radius: var(--card);
    overflow: hidden;
    margin: 25px 0;
}

.price-panel__title {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    background: var(--mist);
    font-weight: 700;
}

.price-panel table {
    width: 100%;
    border-collapse: collapse;
}

.price-panel td {
    padding: 8px 15px;
    border-bottom: 1px solid var(--border);
}

.price-panel td:last-child {
    text-align: right;
    white-space: nowrap;
}

.price-panel tr:last-child td {
    border-bottom: 0;
}

.price-panel__total td {
    background: var(--lime);
    color: var(--charcoal);
    font-weight: 700;
}

.price-panel__note {
    padding: 8px 15px;
    color: var(--muted);
    font-size: 12px;
}

.price-panel__meta {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.price-discount td {
    color: var(--charcoal);
    font-weight: 600;
}

/* --- concentration columns ---------------------------------------------- */

.concentration-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* A bachelor semester always has five columns, Basic plus four
   concentrations, so they share one row; below a tablet they stack. */
@media (max-width: 991px) {
    .concentration-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* Text stays full strength in every column: a course that cannot be picked
   is greyed by `.muted` on its own label, not by its column. */
.concentration-box {
    color: var(--text);
}

.concentration-box__title {
    display: flex;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
}

.concentration-box.is-selected .concentration-box__title {
    border-bottom-color: var(--charcoal);
}

.concentration-box__courses {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 20px;
    margin-bottom: 20px;
}

.totals-bar {
    background: var(--lime);
    color: var(--charcoal);
    border-radius: var(--card);
    padding: 10px 20px;
    font-weight: 700;
    text-align: right;
}

/* --- document upload tiles ---------------------------------------------- */

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.upload-tile {
    border: 1px solid var(--border);
    border-radius: var(--card);
    padding: 20px 15px;
    text-align: center;
}

.upload-tile.is-done {
    border-color: var(--charcoal);
    background: var(--lime-pale);
}

.upload-tile.has-error {
    border-color: var(--error);
}

.upload-tile__title {
    font-size: 120%;
    font-weight: 700;
    margin-bottom: 8px;
}

/* The guide or template for the slot: the old form's thumbnail, with a text
   link under it so it does not read as decoration. */
.upload-tile__template {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--charcoal);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.upload-tile__template img {
    display: block;
    margin: 0 auto 6px;
}

.upload-tile__template:hover span,
.upload-tile__template:focus span {
    text-decoration: underline;
}

.upload-tile__instructions {
    color: var(--muted);
    font-size: 12px;
    min-height: 54px;
    margin-bottom: 12px;
}

.upload-tile__status {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
}

.upload-tile__status--done {
    color: var(--charcoal);
    font-weight: 600;
    word-break: break-all;
}

.upload-tile__status--missing {
    color: var(--muted);
}

/* The native control is hidden and its label is the button. Kept from the old
   form, including the .no-js fallback that shows the real input when the
   label would do nothing. */
.js .upload-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.upload-input + label {
    display: inline-block;
    max-width: 100%;
    padding: 10px 20px;
    font-weight: 700;
    color: var(--charcoal);
    background: var(--lime);
    border-radius: var(--petal);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-js .upload-input + label {
    display: none;
}

.upload-input:focus + label,
.upload-input + label:hover {
    background: var(--charcoal);
    color: var(--lime);
}

.upload-input:focus + label {
    outline: 1px dotted #000;
}

/* --- review ------------------------------------------------------------- */

.review-section {
    border: 1px solid var(--border);
    border-radius: var(--card);
    overflow: hidden;
    margin-bottom: 20px;
}

.review-section__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    background: var(--mist);
}

.review-section__head h3 {
    margin: 0;
    font-size: 17px;
}

.review-list {
    margin: 0;
    padding: 0;
}

.review-list div {
    display: flex;
    gap: 15px;
    padding: 8px 15px;
    border-bottom: 1px solid var(--border);
}

.review-list div:last-child {
    border-bottom: 0;
}

.review-list dt {
    flex: 0 0 40%;
    color: var(--muted);
}

.review-list dd {
    flex: 1 1 60%;
    margin: 0;
    word-break: break-word;
}

.consents {
    margin-bottom: 20px;
}

.consents .choice {
    margin-bottom: 14px;
}

.legal-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 25px;
}

.legal-box {
    padding: 20px;
    overflow: auto;
    height: 200px;
    border: 1px solid var(--border);
}

.markdown h1 {
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    margin: 0 0 6px;
    line-height: 1.6;
}

.markdown h2 {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    text-decoration: underline;
    border-bottom: 0;
    text-align: left;
    padding: 0;
    margin: 0 0 6px;
}

.markdown p {
    line-height: 1.6;
    margin-bottom: 6px;
}

.markdown ul {
    padding-left: 1.5rem;
}

/* --- tom-select --------------------------------------------------------- */

.ts-wrapper.form-control {
    padding: 0;
    border: 0;
}

.ts-wrapper .ts-control {
    border: 1px solid var(--input-border);
    border-radius: 0;
    padding: 7px 10px;
    font-weight: 400;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--charcoal);
    box-shadow: 0 0 0 1px var(--charcoal);
}

.ts-dropdown {
    border-radius: 0;
    border-color: var(--border);
}

.ts-dropdown .active {
    background: var(--lime);
    color: var(--charcoal);
}

/* Alpine sets this on elements it will show once it has booted, so they do not
   flash in their pre-filtered state on a slow connection. */
[x-cloak] {
    display: none !important;
}

/* The page after a successful submit. */
.thank-you {
    max-width: 680px;
    margin: 0 auto 40px;
    padding: 45px 40px 35px;
    background: #fff;
    border-radius: var(--card);
    text-align: center;
}

.thank-you__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--charcoal);
    font-size: 40px;
}

.thank-you h1 {
    margin-top: 0;
}

.thank-you__lead {
    font-size: 17px;
    margin: 0 auto 35px;
    max-width: 500px;
}

.thank-you__subtitle {
    margin: 0 0 15px;
    font-size: 18px;
    text-align: left;
}

.thank-you__steps {
    list-style: none;
    margin: 0 0 35px;
    padding: 0;
    text-align: left;
}

.thank-you__steps li {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.thank-you__steps p {
    margin: 4px 0 0;
    color: var(--muted);
}

.thank-you__step-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--mist);
    color: var(--charcoal);
    font-size: 20px;
}

.thank-you__actions {
    margin: 0 0 20px;
}

.thank-you__contact {
    margin: 0;
    font-size: 14px;
}

@media (max-width: 767px) {
    .thank-you {
        padding: 30px 18px 25px;
    }
}
