:root {
    --primary-color: #0063d2;
    --primary-hover: #0150ab;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --surface: #ffffff;
    --page-bg: #f7f8fa;
}

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

html,
body {
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    background-color: var(--page-bg);
    color: var(--text-dark);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1 0 auto;
}

.all_con {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Fill the viewport (minus header + footer) so the form sits in the middle.
       If the form is taller than this, it grows naturally without clipping. */
    min-height: calc(100vh - 130px);
    padding: 32px 16px;
}

/* Override the inline mt-5 spacing so the card sits nicely */
.all_con.mt-5 {
    margin-top: 0 !important;
}

/* ---------- Header (shared across all frontend pages) ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}
.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0063d2, #2b8bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}
.header-login {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease;
}
.header-login:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

/* Global Stylings */
label {
    display: inline-block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.width-50 {
    width: 30%;
}

.ml-auto {
    margin-left: auto;
}

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

/* Form card */
.form {
    width: 100%;
    max-width: 640px;
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 2rem;
    margin-bottom: 24px;
}

.form > h1,
.form h1.text-center {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.form img {
    border-radius: 8px;
}

/* Inputs */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 99, 210, 0.12);
    outline: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

/* Radio rows */
input[type="radio"] {
    accent-color: var(--primary-color);
    margin-right: 4px;
    margin-left: 6px;
}

input[type="radio"]:first-of-type {
    margin-left: 0;
}

/* Progressbar */
.progressbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    counter-reset: step;
    margin: 1.5rem 0.5rem 3.5rem;
    z-index: 0;
}

.progressbar::before,
.progress {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background-color: #e5e7eb;
    /* z-index 0 keeps the line visible above the form's background; the step
       circles sit above it at z-index 1. (z-index:-1 hid it behind the card.) */
    z-index: 0;
}

/* Flowing "arrow" animation along the connector line (points forward) */
.progressbar::before {
    background-color: #e5e7eb;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(0, 99, 210, 0.55) 0,
        rgba(0, 99, 210, 0.55) 8px,
        transparent 8px,
        transparent 18px
    );
    background-size: 18px 100%;
    background-repeat: repeat-x;
    animation: progressFlow 0.9s linear infinite;
}

@keyframes progressFlow {
    to {
        background-position: 18px 0;
    }
}

.progress {
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.4s ease;
    /* Subtle moving sheen on the filled portion */
    background-image: linear-gradient(
        90deg,
        var(--primary-color),
        #2b8bff,
        var(--primary-color)
    );
    background-size: 200% 100%;
    animation: progressSheen 1.8s linear infinite;
}

@keyframes progressSheen {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
    .progressbar::before,
    .progress {
        animation: none;
    }
}

.progress-step {
    position: relative;
    z-index: 1;
    width: 2.1875rem;
    height: 2.1875rem;
    background-color: #e5e7eb;
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-step::before {
    counter-increment: step;
    content: counter(step);
}

.progress-step::after {
    content: attr(data-title);
    position: absolute;
    top: calc(100% + 0.5rem);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
}

.progress-step-active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Form steps */
.form-step {
    display: none;
    transform-origin: top;
    animation: animate 0.4s;
}

.form-step-active {
    display: block;
}

@keyframes animate {
    from {
        transform: scale(0.98);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.input-group {
    margin: 2rem 0;
}

/* Buttons */
.btns-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.btn_m {
    padding: 0.75rem;
    display: block;
    text-decoration: none;
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn_m:hover {
    background-color: var(--primary-hover);
    color: #fff;
}

.btn_sub {
    border: none;
    width: 100%;
}

.passport_sub {
    grid-template-columns: repeat(1, 1fr);
}

/* Section heading tags */
.tags,
#content2 .tags,
#content3 .tags {
    background-color: transparent;
    text-align: left;
    color: var(--text-dark);
    padding: 0 0 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary-color);
}

.tags h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

#content2 input {
    font-size: 0.95rem;
}

.content-div-up input {
    font-weight: 500;
}

/* Academic table rows: keep the disabled label cells subtle */
.all_table_row .form-control:disabled {
    background-color: #f1f3f5;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

/* Language test buttons */
#language-test button {
    width: 100%;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    padding: 0.55rem 0.25rem;
    transition: background-color 0.15s ease;
}

#language-test button:hover {
    background-color: var(--primary-hover);
}

.toggle-input-container-hidden {
    display: none;
}

.toggle-input-container-active {
    display: flex;
}

#toggle-input-container input {
    font-size: 0.9rem;
    font-weight: 400;
}

#close-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

#close-btn {
    width: 18px;
    height: 18px;
    display: block;
    cursor: pointer;
}

/* Header brand logo image */
.brand-logo-img {
    height: 42px;
    width: auto;
    display: block;
}

/* ---------- Footer (shared across all frontend pages) ---------- */
.site-footer {
    flex-shrink: 0;
    width: 100%;
    background: #0f1b2d;
    color: #cdd6e4;
}
.footer-top {
    max-width: 1120px;
    margin: 0 auto;
    padding: 34px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.footer-logo-img {
    height: 46px;
    width: auto;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
}
.footer-brand strong {
    color: #fff;
    font-size: 1.05rem;
    display: block;
}
.footer-brand p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #9fb0c7;
    max-width: 300px;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
}
.footer-links a {
    color: #cdd6e4;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}
.footer-links a:hover {
    color: #fff;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #8fa0b8;
}

/* SweetAlert button */
/* SweetAlert success popup — modern box */
.swal-overlay {
    background-color: rgba(15, 23, 42, 0.45);
}
.swal-modal {
    border-radius: 18px;
    padding: 26px 26px 22px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    animation: swalPop 0.25s ease;
}
@keyframes swalPop {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.swal-icon {
    margin-top: 6px;
}
.swal-icon--success__ring {
    border-color: rgba(22, 163, 74, 0.25);
}
.swal-icon--success__line {
    background-color: #16a34a;
}
.swal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 10px 0 4px;
}
.swal-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
}
.swal-footer {
    text-align: center;
    margin-top: 14px;
}
.swal-button {
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    padding: 10px 30px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(0, 99, 210, 0.28);
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.swal-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}
.swal-button:focus {
    box-shadow: 0 0 0 3px rgba(0, 99, 210, 0.25);
}

/* Tablet */
@media (max-width: 768px) {
    .form {
        padding: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .all_con {
        padding: 20px 12px;
    }
    .form {
        padding: 1.25rem;
        border-radius: 12px;
    }
    .form > h1,
    .form h1.text-center {
        font-size: 1.35rem;
    }
    #content2 input {
        font-size: 0.9rem;
    }
    .all_table_row .col {
        padding: 0 4px;
    }
    .all_lang_test .col {
        padding: 4px;
    }
    #language-test button {
        font-size: 0.8rem;
    }
    .progressbar {
        margin: 1rem 0.25rem 3rem;
    }
}
