:root {
    --primary: #d11124;
    --primary-hover: #a30d1c;
    --secondary: #0f172a;
    --secondary-hover: #1e293b;
    --bg-body: #f8fafc;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --white: #ffffff;
    --red-soft: #fff1f2;
    --red-border: #fecdd3;
    --blue-soft: #eff6ff;
    --blue-border: #bfdbfe;
    --blue-accent: #3b82f6;
    --blue-dark: #1e3a8a;
    --green: #10b981;
    --radius: 8px;
    --radius-lg: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5 {
    font-family: 'Poppins', sans-serif;
    color: var(--secondary);
}

a {
    color: inherit;
}

.uppercase {
    text-transform: uppercase;
}

/* ===== Header ===== */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 900;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text i {
    color: var(--primary);
    font-size: 24px;
}

.logo-text span {
    color: var(--primary);
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
    color: var(--white);
    text-align: center;
    padding: 60px 20px 80px;
}

.hero h1 {
    color: var(--white);
    font-size: 32px;
    margin-bottom: 15px;
    line-height: 1.35;
    text-wrap: balance;
}

.hero p {
    color: #cbd5e1;
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== Layout ===== */
.container {
    max-width: 900px;
    margin: -40px auto 50px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* ===== Progress Indicator ===== */
.progress-track {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 84px;
}

.progress-dot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border: 2px solid var(--border-light);
    color: var(--text-muted);
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    transition: all 0.3s ease;
}

.progress-step.is-active .progress-dot {
    background: var(--white);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(209, 17, 36, 0.12);
}

.progress-step.is-done .progress-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.progress-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    max-width: 96px;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: var(--border-light);
    border-radius: 3px;
    margin: 23px 10px 0;
    min-width: 14px;
    transition: background 0.3s ease;
}

.progress-step.is-done + .progress-line {
    background: var(--primary);
}

/* ===== Alert Box ===== */
.alert-box {
    background-color: var(--red-soft);
    border: 1px solid var(--red-border);
    border-left: 5px solid var(--primary);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow-wrap: anywhere;
}

.alert-box h4 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 18px;
}

.alert-box h4 i {
    flex-shrink: 0;
}

.alert-box a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.alert-box--blue {
    background-color: var(--blue-soft);
    border-color: var(--blue-border);
    border-left-color: var(--blue-accent);
    margin-top: 30px;
    margin-bottom: 0;
}

.alert-box--blue h4 {
    color: var(--blue-dark);
    margin-bottom: 12px;
}

.alert-box--blue p {
    color: var(--blue-dark);
    margin: 0;
    font-size: 14.5px;
}

/* ===== Step Cards ===== */
.step-card {
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: opacity 0.3s ease;
}

.step-card.is-open > .step-content {
    display: block;
}

.step-card.is-done:not(.is-open) > .step-content {
    display: none;
}

.step-card.is-locked {
    opacity: 0.5;
    filter: grayscale(100%);
    pointer-events: none;
}

.step-card.is-locked > .step-content {
    display: none;
}

.step-card.is-locked .step-toggle {
    display: none;
}

.step-card.is-done .btn-confirm {
    display: none;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.3s ease;
}

.step-number {
    background-color: var(--primary);
    color: var(--white);
    width: 45px;
    height: 45px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(209, 17, 36, 0.3);
}

.step-number i {
    font-size: 20px;
}

.step-title {
    font-size: 22px;
    margin: 0;
    line-height: 1.4;
}

.step-toggle {
    margin-left: auto;
    color: var(--primary);
    background-color: var(--red-soft);
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    user-select: none;
}

.step-content {
    display: none;
    margin-top: 20px;
}

.step-action {
    border-top: 1px solid var(--border-light);
    margin-top: 30px;
    padding-top: 25px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(209, 17, 36, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary--secondary {
    background-color: var(--secondary);
    box-shadow: none;
}

.btn-primary--secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary);
    border-color: var(--border-light);
}

.btn-outline:hover {
    background-color: var(--bg-body);
    border-color: var(--secondary);
}

.btn-outline--white {
    background: var(--white);
}

.btn-outline--dark {
    border-color: var(--secondary);
    background: var(--white);
}

.btn-muted {
    border-color: var(--border-light);
    color: var(--text-muted);
}

.btn-muted:hover {
    border-color: var(--text-muted);
    background: var(--bg-body);
    color: var(--text-muted);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    font-size: 14px;
}

/* ===== Lists ===== */
.list-custom {
    list-style: none;
}

.list-custom li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
}

.list-custom li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--green);
}

.highlight {
    font-weight: 700;
    color: var(--secondary);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.95em;
}

/* ===== Sub Box ===== */
.sub-box {
    background-color: var(--bg-body);
    border-left: 4px solid var(--secondary);
    padding: 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-top: 20px;
}

.sub-box h5 {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Task Sections ===== */
.task-heading {
    margin-top: 35px;
    margin-bottom: 15px;
}

.task-box {
    border: 2px solid var(--secondary);
    background-color: var(--bg-body);
    border-radius: 10px;
    padding: 25px;
    margin-top: 25px;
}

.task-box h4 {
    margin-bottom: 10px;
}

.task-box ul {
    margin: 15px 0 20px;
}

.pink-box {
    background-color: var(--red-soft);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 25px;
}

.pink-box h4 {
    color: var(--primary);
    margin-bottom: 10px;
}

.pink-box p,
.gray-box p {
    font-size: 14.5px;
}

.pink-box ul,
.gray-box ul {
    margin: 15px 0;
}

.gray-box {
    background-color: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 25px;
}

.gray-box h4 {
    margin-bottom: 10px;
}

/* ===== Notes ===== */
.note {
    font-size: 14.5px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.sub-note {
    font-size: 14px;
    margin-bottom: 15px;
}

.hint {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ===== Iframes ===== */
.iframe-container {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    margin: 20px 0;
    background: var(--white);
}

.iframe-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--white);
    z-index: 10;
    gap: 10px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.iframe-loading span {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 0 16px;
}

.iframe-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.iframe-embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    padding: 35px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    margin-bottom: 10px;
    font-size: 22px;
    text-align: center;
}

.modal-content > p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 25px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    min-height: 46px;
    outline: none;
}

.form-group input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(209, 17, 36, 0.15);
}

.checklist-group {
    background: var(--bg-body);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: 25px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.check-item:last-child {
    margin-bottom: 0;
}

.check-item input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.check-item span {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-main);
}

.modal-buttons {
    display: flex;
    gap: 15px;
}

.modal-buttons .btn {
    flex: 1;
}

body.modal-open {
    overflow: hidden;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 800;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.back-to-top:hover {
    background: var(--primary);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== Footer ===== */
footer {
    background-color: var(--secondary);
    color: #94a3b8;
    text-align: center;
    padding: 40px 20px;
    border-top: 5px solid var(--primary);
}

footer p {
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-logo {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 10px;
    display: inline-block;
}

.footer-logo span {
    color: var(--primary);
}

/* ===== Focus Visible ===== */
.btn:focus-visible,
.back-to-top:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(209, 17, 36, 0.4);
    outline-offset: 2px;
}

.step-header:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }

    .btn-primary:hover {
        transform: none;
    }
}

/* ===== Responsive: 900px ===== */
@media (max-width: 900px) {
    .step-title {
        font-size: 20px;
    }

    .modal-content {
        padding: 30px;
    }
}

/* ===== Responsive: 768px ===== */
@media (max-width: 768px) {
    .hero {
        padding: 48px 20px 70px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .container {
        margin-top: -20px;
    }

    .step-card {
        padding: 25px 20px;
    }

    .step-title {
        font-size: 18px;
    }

    .step-number {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .progress-track {
        padding: 16px 14px;
    }

    .progress-label {
        font-size: 11px;
        max-width: 72px;
    }

    .iframe-container {
        height: 480px;
    }
}

/* ===== Responsive: 480px ===== */
@media (max-width: 480px) {
    .hero {
        padding: 40px 16px 60px;
    }

    .hero h1 {
        font-size: 23px;
    }

    .hero p {
        font-size: 15px;
    }

    .container {
        padding: 0 16px;
    }

    .step-card {
        padding: 22px 16px;
    }

    .step-card .step-number {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .step-header {
        gap: 12px;
    }

    .step-toggle {
        padding: 5px 10px;
        font-size: 11px;
    }

    .modal-content {
        padding: 26px 18px;
    }

    .modal-content h3 {
        font-size: 19px;
    }

    .iframe-container {
        height: 460px;
    }

    .progress-dot {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .progress-line {
        margin: 20px 6px 0;
    }

    .progress-label {
        display: none;
    }

    .alert-box {
        padding: 16px;
    }

    .alert-box h4 {
        font-size: 16px;
    }

    .task-box,
    .pink-box,
    .gray-box {
        padding: 16px;
    }

    .footer-logo {
        font-size: 18px;
    }

    .back-to-top {
        right: 14px;
        bottom: 14px;
    }
}

/* ===== Responsive: 360px ===== */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 21px;
    }

    .container {
        padding: 0 12px;
    }

    .step-title {
        font-size: 16px;
    }

    .progress-step {
        min-width: 34px;
    }

    .progress-track {
        padding: 14px 8px;
    }
}