/* ================================================
   MIDDLEBELT PATRIOTS — COLORFUL INTERACTIVE PORTAL
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700;800&display=swap');

:root {
    --red: #e53935;
    --blue: #1e88e5;
    --orange: #fb8c00;
    --green: #0d4d29;
    --green-light: #43a047;
    --gold: #fdd835;
    --purple: #8e24aa;
    --teal: #00897b;
    --pink: #ec407a;
    --text: #1a1a2e;
    --text-muted: #78849e;
    --white: #ffffff;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 25px 15px;
    overflow-x: hidden;
    background: #0a0a1a;
}

/* ========== ANIMATED CANVAS BG ========== */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(30, 136, 229, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(229, 57, 53, 0.06) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}

/* ========== CONTAINER ========== */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 580px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 28px;
    padding: 40px 35px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 70px -10px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(30, 136, 229, 0.06);
    animation: cardIn 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== HEADER ========== */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-glow {
    display: inline-block;
    position: relative;
    margin-bottom: 12px;
    animation: logoPop 0.8s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.logo-glow::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: conic-gradient(from 0deg, var(--red), var(--blue), var(--orange), var(--gold), var(--red));
    border-radius: 50%;
    opacity: 0.12;
    filter: blur(20px);
    animation: haloSpin 8s linear infinite;
    z-index: -1;
}

@keyframes haloSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes logoPop {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(-15deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.logo-img {
    max-width: 140px;
    height: auto;
    filter: drop-shadow(0 5px 20px rgba(0, 0, 0, 0.12));
}

.title-animate {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--red), var(--blue), var(--orange), var(--red));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowMove 5s linear infinite;
}

@keyframes rainbowMove {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.subtitle-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.subtitle-line {
    width: 35px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: fadeStretch 1.2s 0.6s ease both;
}

@keyframes fadeStretch {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: 35px;
        opacity: 1;
    }
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 600;
}

/* ========== PROGRESS DOTS ========== */
.progress-container {
    position: relative;
    margin-bottom: 32px;
}

.progress-dots {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    padding: 0 5px;
}

.progress-track {
    position: absolute;
    top: 50%;
    left: 30px;
    right: 30px;
    height: 3px;
    background: #e8eaf0;
    border-radius: 10px;
    transform: translateY(-50%);
    z-index: 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--red), var(--orange), var(--blue));
    background-size: 200% 100%;
    animation: barShimmer 2s linear infinite;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes barShimmer {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e8eaf0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.dot span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b0b5c3;
    transition: all 0.4s;
    z-index: 2;
}

.dot.active {
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow:
        0 0 0 4px rgba(229, 57, 53, 0.15),
        0 4px 15px rgba(229, 57, 53, 0.25);
    transform: scale(1.15);
}

.dot.active span {
    color: white;
}

/* Pulse ring on active dot */
.dot.active::before {
    content: '';
    position: absolute;
    inset: -6px;
    border: 2px solid rgba(229, 57, 53, 0.3);
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ========== FORM SECTIONS ========== */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: slideIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 22px;
    padding-bottom: 10px;
    position: relative;
    color: var(--text);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--orange));
    border-radius: 10px;
    transition: width 0.4s ease;
}

.form-section.active .section-title::after {
    animation: titleLine 0.6s 0.3s ease both;
}

@keyframes titleLine {
    from {
        width: 0;
    }

    to {
        width: 50px;
    }
}

/* ========== INPUTS ========== */
.input-group {
    margin-bottom: 18px;
    position: relative;
}

.row {
    display: flex;
    gap: 12px;
}

.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e8eaf0;
    border-radius: 14px;
    background: rgba(248, 249, 252, 0.7);
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    background: white;
    box-shadow:
        0 0 0 4px rgba(30, 136, 229, 0.08),
        0 4px 12px rgba(30, 136, 229, 0.06);
    transform: translateY(-1px);
}

/* Rainbow glow line under focused inputs */
.input-glow {
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, var(--red), var(--orange), var(--blue), var(--purple));
    background-size: 300% 100%;
    border-radius: 0 0 14px 14px;
    opacity: 0;
    transition: opacity 0.3s;
}

input:focus~.input-glow {
    opacity: 1;
    animation: glowRun 2s linear infinite;
}

@keyframes glowRun {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

textarea {
    resize: vertical;
    min-height: 70px;
}

select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2378849e' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 35px;
}

/* ========== FILE UPLOAD ========== */
.file-drop-area {
    position: relative;
    border: 2px dashed #d0d5dd;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(135deg, rgba(248, 249, 252, 0.8), rgba(240, 242, 248, 0.5));
    overflow: hidden;
}

.file-drop-area:hover {
    border-color: var(--blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.08);
}

.file-drop-area:hover .upload-icon-ring {
    transform: scale(1.15);
    border-color: var(--blue);
}

.upload-icon-wrap {
    position: relative;
    display: inline-block;
    font-size: 1.8rem;
    color: var(--blue);
    margin-bottom: 8px;
}

.upload-icon-ring {
    position: absolute;
    inset: -10px;
    border: 2px dashed #d0d5dd;
    border-radius: 50%;
    transition: all 0.4s;
    animation: ringRotate 10s linear infinite;
}

@keyframes ringRotate {
    to {
        transform: rotate(360deg);
    }
}

.file-msg {
    display: block;
    font-size: 0.88rem;
    color: #666;
    margin-bottom: 3px;
}

.file-msg strong {
    color: var(--blue);
}

.file-types {
    font-size: 0.72rem;
    color: #aaa;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop-area.has-file {
    border-style: solid;
    border-color: var(--green-light);
    background: rgba(67, 160, 71, 0.04);
}

/* ========== DECLARATION ========== */
.declaration-card {
    background: linear-gradient(135deg, #fafbff, #f0f4ff);
    border: 1px solid #e3e8f4;
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 18px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
}

.checkbox-group+.checkbox-group {
    border-top: 1px solid #e3e8f4;
}

.checkbox-group input[type="checkbox"] {
    display: none;
}

.custom-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #ccd1dc;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: 1px;
    position: relative;
    overflow: hidden;
}

.custom-check::after {
    content: '✓';
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkbox-group input:checked+label .custom-check {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(13, 77, 41, 0.25);
    transform: scale(1.08);
}

.checkbox-group input:checked+label .custom-check::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #555;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
}

/* ========== PAYMENT CARDS ========== */
.payment-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.payment-options {
    display: flex;
    gap: 12px;
}

.payment-card {
    flex: 1;
    border: 2px solid #e8eaf0;
    border-radius: 18px;
    padding: 22px 15px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: rgba(248, 249, 252, 0.7);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.payment-card input {
    display: none;
}

.pay-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--red), var(--orange), var(--blue));
    opacity: 0;
    transition: opacity 0.3s;
}

.payment-card.selected .pay-top {
    opacity: 1;
}

.payment-card h4 {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text);
}

.pay-price {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pay-check {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.1rem;
    color: #ddd;
    transition: all 0.35s;
}

.payment-card.selected {
    border-color: var(--blue);
    background: rgba(30, 136, 229, 0.03);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.1);
}

.payment-card.selected .pay-check {
    color: var(--blue);
}

.payment-card:hover {
    transform: scale(1.03);
    border-color: #c5cad8;
}

/* ========== BUTTONS ========== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
}

.btn {
    padding: 12px 26px;
    border: none;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.btn-prev {
    background: #f0f2f7;
    color: #666;
    border: 1px solid #e0e3ea;
}

.btn-prev:hover {
    background: #e4e7ef;
    transform: translateX(-3px);
}

.btn-next {
    background: linear-gradient(135deg, var(--blue), #1565c0);
    color: white;
    box-shadow: 0 4px 18px rgba(30, 136, 229, 0.25);
}

.btn-next:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(30, 136, 229, 0.35);
}

.btn-submit {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white;
    box-shadow: 0 4px 18px rgba(13, 77, 41, 0.2);
    font-size: 1rem;
}

/* Shimmer sweep on submit */
.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(13, 77, 41, 0.3);
}

/* ========== FOOTER ========== */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f0;
}

.footer p {
    color: #b5bac8;
    font-size: 0.75rem;
}

/* ========== SUCCESS MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(10, 10, 26, 0.7);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 50px 35px;
    border-radius: 28px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

#confettiCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

@keyframes modalPop {
    from {
        transform: scale(0.5) rotate(-3deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Animated SVG Check */
.success-check {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
}

.success-check svg {
    width: 80px;
    height: 80px;
}

.success-check circle {
    stroke: var(--green-light);
    stroke-width: 2;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: drawCircle 0.6s 0.2s ease forwards;
}

.success-check path {
    stroke: var(--green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.4s 0.7s ease forwards;
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.modal-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.btn-modal {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white;
    padding: 13px 40px;
    border-radius: 14px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(13, 77, 41, 0.2);
    position: relative;
    z-index: 1;
}

.btn-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 77, 41, 0.3);
}

/* ========== ERROR SHAKE ========== */
.input-error {
    border-color: var(--red) !important;
    animation: shake 0.45s ease;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1) !important;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 520px) {
    .container {
        padding: 25px 18px;
        border-radius: 20px;
    }

    .row {
        flex-direction: column;
        gap: 0;
    }

    .logo-img {
        max-width: 110px;
    }

    .title-animate {
        font-size: 1.6rem;
    }

    .dot {
        width: 32px;
        height: 32px;
    }

    .dot span {
        font-size: 0.75rem;
    }

    .progress-track {
        left: 22px;
        right: 22px;
    }

    .payment-options {
        flex-direction: column;
    }

    .modal-content {
        padding: 35px 20px;
    }
}