:root {
    --bg: #080c18;
    --card-bg: #1e1e1e;
    --text: #fff;
    --accent: #fff;
    --accent-light: #b0bec5;
    --input-border: #555;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    --step-inactive: #444;
    --step-active: #90a4ae;
    --step-done: #43a047;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --transition: 0.25s ease;
    --step-inactive: #dce4ec;
    --step-active: #2c3e50;
    --step-done: #27ae60;
}

.dark {
    --bg: #080c18;
    --card-bg: #1e1e1e;
    --text: #fff;
    --accent: #fff;
    --accent-light: #b0bec5;
    --input-border: #555;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    --step-inactive: #444;
    --step-active: #90a4ae;
    --step-done: #43a047;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Indie Flower', cursive;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../assets/bg.jpg') center/cover no-repeat fixed;
    padding-top: 80px;
    padding-bottom: 2rem;
    line-height: 1.8;
    color: var(--text);
    transition: color var(--transition);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg);
    color: var(--accent-light);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    border-bottom: 1px solid #f5f5f5;
    padding-left: 10%;
    padding-right: 10%;
    transition: background var(--transition);
}

.dark .site-header {
    border-bottom: 1px solid #333;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo span {
    text-transform: capitalize;
}

.header-logo i {
    font-size: 1.8rem;
}

.header-nav {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    color: var(--accent-light);
}

.header-nav .policy-tab,
.header-nav .lookup-btn,
.header-nav .darkmode-toggle {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-family: 'Indie Flower', cursive;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color var(--transition);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
}

.header-nav .policy-tab:hover,
.header-nav .lookup-btn:hover,
.header-nav .darkmode-toggle:hover {
    color: var(--accent-light);
    background: rgba(255, 255, 255, 0.1);
}

.dark .header-nav .policy-tab:hover,
.dark .header-nav .lookup-btn:hover,
.dark .header-nav .darkmode-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.darkmode-toggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.lookup-btn {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius);
    max-width: 640px;
    width: 90%;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: fadeSlideIn 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.dark .modal-box {
    background: #2a2a2a;
    color: var(--text);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--accent);
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent);
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 0.5rem;
}

.dark .modal-title {
    border-bottom-color: #444;
}

.modal-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.dark .modal-content {
    color: #ccc;
}

.container {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
    /* border-left: 1px solid #f5f5f5;
    border-right: 1px solid #f5f5f5; */
}

.dark .container {
    border-color: #333;
}

.card {
    /* background: var(--bg); */
    border-radius: var(--radius);
    padding: 2.5rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
    transition: background var(--transition);
}

.stepper {
    flex: 0 0 210px;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    padding-right: 1.5rem;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    position: relative;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.step-item.active {
    opacity: 1;
}

.step-item.done {
    opacity: 1;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--step-inactive);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background var(--transition);
    flex-shrink: 0;
}

.step-item.active .step-circle {
    background: var(--step-active);
}

.step-item.done .step-circle {
    background: var(--step-done);
}

.step-info {
    display: flex;
    flex-direction: column;
}

.step-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent);
}

.step-desc {
    font-size: 0.75rem;
    color: #7f8c8d;
}

.dark .step-desc {
    color: #aaa;
}

.step-line {
    position: absolute;
    left: 13px;
    top: 34px;
    bottom: -24px;
    width: 2px;
    background: var(--step-inactive);
    z-index: 0;
}

.step-item:last-child .step-line {
    display: none;
}

.step-item.done .step-line {
    background: var(--step-done);
}

.step-item.active .step-line {
    background: var(--step-active);
}

.form-content {
    flex: 1;
    min-width: 280px;
}

.header-section {
    text-align: center;
    padding-bottom: 1.5rem;
    margin-top: 20px;
    /* border-bottom: 1px solid #f5f5f5; */
}

/* .dark .header-section {
    border-bottom: 1px solid #333;
} */

.header-icon {
    font-size: 2.4rem;
    display: block;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.header-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    letter-spacing: 0.02em;
}

.dark .header-subtitle {
    color: #aaa;
}

.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.selection-card {
    position: relative;
    background: #fff;
    border: 2px dashed var(--input-border);
    border-radius: 18px;
    padding: 2rem 1.8rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Indie Flower', cursive;
    font-size: 1.3rem;
}

.dark .selection-card {
    background: var(--bg);
    border-color: #555;
}

.selection-card:hover {
    border-color: var(--accent);
    background: #f8fafb;
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.dark .selection-card:hover {
    background: #333;
}

.selection-card.selected {
    border: 2px solid var(--accent);
    background: #eef2f5;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.15);
}

.dark .selection-card.selected {
    background: #3c3c3c;
}

.selection-card.selected::after {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 1.4rem;
    color: var(--step-done);
}

.selection-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.card-icon {
    font-size: 2.8rem;
    color: var(--accent);
}

.selection-card.selected .card-icon {
    transform: scale(1.1);
}

.card-label {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--accent);
}

.card-desc {
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.4;
}

.dark .card-desc {
    color: #aaa;
}

.announcement-text {
    font-size: 1.25rem;
    text-align: justify;
    word-spacing: 0.08em;
    padding: 0.5rem 0;
    line-height: 2;
}

.blank-wrapper {
    display: inline-block;
    vertical-align: bottom;
    margin: 0 0.2em;
}

.blank-input {
    border: none;
    border-bottom: 2.5px dashed var(--input-border);
    background: transparent;
    font-family: inherit;
    font-size: 1.25rem;
    color: var(--text);
    padding: 0.2em 0.3em;
    min-width: 80px;
    text-align: center;
    outline: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.5;
    width: auto;
    transition: border-color var(--transition), box-shadow var(--transition);
    border-radius: 6px 6px 0 0;
}

.blank-input:focus {
    border-bottom-color: var(--accent);
    background: #f8fafb;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
}

.dark .blank-input:focus {
    background: #333;
}

.blank-input::placeholder {
    color: #b0b0b0;
    font-style: italic;
    font-size: 0.9em;
}

.announcement-textarea {
    width: 100%;
    min-height: 220px;
    border: 2.5px dashed var(--input-border);
    border-radius: 12px;
    background: #fdfdfd;
    font-family: 'Indie Flower', cursive;
    font-size: 1.2rem;
    color: var(--text);
    padding: 1.2rem 1.4rem;
    outline: none;
    letter-spacing: 0.02em;
    line-height: 1.9;
    resize: vertical;
    transition: all var(--transition);
}

.dark .announcement-textarea {
    background: #2a2a2a;
}

.announcement-textarea:focus {
    border-color: var(--accent);
    background: #fafcfd;
}

.dark .announcement-textarea:focus {
    background: #333;
}

.announcement-textarea::placeholder {
    color: #b0b0b0;
    font-style: italic;
}

.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1rem 0;
}

.slot-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border: 1px dashed var(--input-border);
    border-radius: 20px;
    transition: all var(--transition);
    color: var(--text);
}

.slot-checkbox:hover {
    border-color: var(--accent);
    background: #f8fafb;
}

.dark .slot-checkbox:hover {
    background: #333;
}

.slot-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
}

.additional-fields {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
}

.field-group {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.field-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
}

.field-input,
.field-select {
    width: 100%;
    border: none;
    border-bottom: 2px dashed var(--input-border);
    background: transparent;
    font-family: 'Indie Flower', cursive;
    font-size: 1rem;
    padding: 0.7em 1em;
    border-radius: 6px 6px 0 0;
    transition: all var(--transition);
    outline: none;
    color: var(--text);
}

.field-input:focus,
.field-select:focus {
    border-bottom-color: var(--accent);
    background: #f8fafb;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
}

.dark .field-input:focus,
.dark .field-select:focus {
    background: #333;
}

.button-row {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    padding: 0.85em 2.2em;
    border: none;
    border-radius: 50px;
    font-family: 'Indie Flower', cursive;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all var(--transition);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background: #2c3e50;
    color: #fff;
}

.btn-primary:hover {
    background: #1e2b38;
    transform: translateY(-2px);
}

.dark .btn-primary {
    background: #455a64;
}

.dark .btn-primary:hover {
    background: #546e7a;
}

.btn-outline {
    background: #fff;
    color: #2c3e50;
    border: 2px solid #dce4ec;
}

.dark .btn-outline {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #555;
}

.btn-outline:hover {
    background: #f7f9fc;
    border-color: #2c3e50;
    transform: translateY(-2px);
}

.dark .btn-outline:hover {
    background: #383838;
    border-color: #90a4ae;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.result-section {
    margin-top: 2rem;
    padding: 1.8rem 2rem;
    background: #f8fafb;
    border: 1px solid #eaeaea;
    animation: fadeSlideIn 0.4s ease;
}

.dark .result-section {
    background: #2a2a2a;
    border-color: #444;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7f8c8d;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.dark .result-label {
    color: #aaa;
}

.result-text {
    font-size: 1.15rem;
    line-height: 1.9;
    word-spacing: 0.08em;
    background: #fff;
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #2c3e50;
    white-space: pre-wrap;
}

.dark .result-text {
    background: #333;
    border-left-color: #90a4ae;
}

.result-text .highlight {
    font-weight: 700;
    color: #2c3e50;
    text-decoration: underline;
    text-decoration-color: #7f8c8d;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
}

.dark .result-text .highlight {
    color: #b0bec5;
    text-decoration-color: #90a4ae;
}

.extra-info {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    background: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #2c3e50;
}

.dark .extra-info {
    background: #333;
    border-left-color: #90a4ae;
}

.extra-info span {
    font-weight: 600;
}

.message {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #27ae60;
}

.error-list {
    color: #c0392b;
    margin-bottom: 1rem;
    list-style: none;
}

.sig-line {
    text-align: right;
    margin-top: 1.8rem;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
    border-top: 1px solid #eaeaea;
    padding-top: 1.2rem;
}

.dark .sig-line {
    color: #aaa;
    border-top-color: #444;
}

.lookup-section {
    padding: 2rem 0;
}

.lookup-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.lookup-form .field-input {
    flex: 1;
    min-width: 220px;
    padding: 0.7em 1em;
    font-size: 1.1rem;
    color: var(--text);
}

.announcement-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
}

.dark .announcement-card {
    background: #2a2a2a;
    border-color: #444;
}

.announcement-card .title {
    font-weight: 600;
    color: var(--accent);
    display: flex;
    justify-content: space-between;
}

.type-badge {
    font-size: 0.8rem;
    padding: 0.2em 0.8em;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    text-transform: uppercase;
}

.announcement-card .detail {
    margin-top: 0.5rem;
    color: var(--text);
}

@media (max-width: 700px) {
    .card {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .stepper {
        flex: 1 1 auto;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
        padding-bottom: 1.2rem;
        padding-right: 0;
        justify-content: center;
    }

    .dark .stepper {
        border-bottom-color: #444;
    }

    .step-line {
        display: none;
    }

    .step-item {
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    .announcement-text {
        font-size: 1.1rem;
    }

    .blank-input {
        font-size: 1.1rem;
        min-width: 60px;
    }

    .announcement-textarea {
        font-size: 1rem;
        min-height: 170px;
    }

    .header-nav {
        gap: 0.5rem;
    }

    .header-nav .policy-tab,
    .header-nav .lookup-btn,
    .header-nav .darkmode-toggle {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }

    .darkmode-toggle {
        width: 34px;
        height: 34px;
    }
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--input-border) var(--bg);
}

.payment-waiting {
    max-width: 480px;
    margin: 3rem auto;
    padding: 2.5rem 2rem;
    text-align: center;
    border-radius: 1.25rem;
    background: var(--bg);
}

.payment-waiting .momo-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 1rem;
    margin-bottom: 1.25rem;
}

.payment-waiting h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1a1a2e;
}

.payment-waiting .payment-meta {
    font-size: 0.97rem;
    color: #555;
    margin-bottom: 2rem;
}

.payment-waiting .payment-meta strong {
    color: #1a1a2e;
}

/* Animated ring */
.pw-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 5px solid #e8f4fd;
    border-top-color: #007bff;
    animation: pw-spin 0.9s linear infinite;
}

@keyframes pw-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status message area */
#statusMessage {
    min-height: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#statusMessage .status-label {
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

/* Success / error states */
.pw-success-icon,
.pw-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 0.5rem;
}

.pw-success-icon {
    background: #e6f9f0;
    color: #1a9e5e;
}

.pw-error-icon {
    background: #fdecea;
    color: #d32f2f;
}

.pw-success-text {
    color: #1a9e5e;
    font-weight: 600;
    font-size: 1rem;
}

.pw-error-text {
    color: #d32f2f;
    font-weight: 600;
    font-size: 1rem;
}

/* Divider */
.pw-divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 1.75rem 0 1.5rem;
}

/* Expiry note */
.pw-note {
    font-size: 0.82rem;
    color: #999;
    margin-top: 1.25rem;
}

/* Cancel button */
.pw-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.4rem;
    border-radius: 2rem;
    border: 1.5px solid #ccc;
    background: transparent;
    color: #444;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.pw-cancel:hover {
    border-color: #888;
    color: #111;
}