/* ==================================================
   NXT CA – Answer Sheet Submission Portal
   Premium SaaS Design System
   ================================================== */

/* ==================================================
   1. DESIGN TOKENS
   ================================================== */

:root {
    /* Brand */
    --primary: #0A4DFF;
    --primary-hover: #083FD4;
    --primary-ghost: rgba(10, 77, 255, 0.06);

    /* Surfaces */
    --bg: #F8FAFC;
    --card: #FFFFFF;

    /* Text */
    --text: #0F172A;
    --text-secondary: #64748B;
    --text-placeholder: #94A3B8;

    /* Borders */
    --border: #E2E8F0;
    --border-hover: #CBD5E1;

    /* Status */
    --success: #16A34A;
    --success-ghost: rgba(22, 163, 74, 0.08);
    --danger: #DC2626;
    --danger-ghost: rgba(220, 38, 38, 0.06);
    --warning: #F59E0B;
    --warning-ghost: rgba(245, 158, 11, 0.08);

    /* Radii */
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.08);
    --shadow-toast: 0 12px 40px rgba(15, 23, 42, 0.14);

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;

    /* Font */
    --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root[data-theme="dark"] {
    --bg: #000000;
    --card: #0B0B0F;
    --card-secondary: #111317;
    --input-bg: #121212;
    --upload-bg: #101114;
    
    --text: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.55);
    --text-placeholder: rgba(255, 255, 255, 0.35);
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(255, 255, 255, 0.02) inset;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(255, 255, 255, 0.02) inset;
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(255, 255, 255, 0.02) inset;
    --shadow-toast: 0 12px 40px rgba(0, 0, 0, 0.7), 0 1px 2px rgba(255, 255, 255, 0.03) inset;
    
    --primary-ghost: rgba(10, 77, 255, 0.15);
    --success-ghost: rgba(22, 163, 74, 0.15);
    --danger-ghost: rgba(220, 38, 38, 0.15);
    --warning-ghost: rgba(245, 158, 11, 0.15);
}

/* ==================================================
   2. RESET
   ================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input {
    font-size: 16px; /* Prevent iOS zoom */
    font-family: inherit;
}

body.theme-transitioning,
body.theme-transitioning * {
    transition: background-color 400ms cubic-bezier(0.4, 0, 0.2, 1),
                border-color 400ms cubic-bezier(0.4, 0, 0.2, 1),
                color 400ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1),
                fill 400ms cubic-bezier(0.4, 0, 0.2, 1),
                stroke 400ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ==================================================
   3. BACKGROUND
   ================================================== */

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Subtle grid */
.bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(10, 77, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 77, 255, 0.025) 1px, transparent 1px);
    background-size: 52px 52px;
}

/* Accent blobs */
.bg__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.bg__blob--tl {
    width: 400px;
    height: 400px;
    background: #0A4DFF;
    opacity: 0.06;
    top: -180px;
    left: -160px;
}

.bg__blob--br {
    width: 340px;
    height: 340px;
    background: #7C3AED;
    opacity: 0.05;
    bottom: -140px;
    right: -140px;
}

/* ==================================================
   4. PAGE LAYOUT
   ================================================== */

.page {
    width: 100%;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

/* ==================================================
   5. CARD
   ================================================== */

.card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 52px 40px;
    box-shadow: var(--shadow-lg);
    animation: cardIn 0.5s var(--ease) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide success view by default */
#successView {
    display: none;
}

/* ==================================================
   6. HEADER
   ================================================== */

.header {
    text-align: center;
    margin-bottom: 8px;
}

/* Graduation cap badge */
.header__badge {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-ghost);
    border: 1px solid rgba(10, 77, 255, 0.1);
    font-size: 30px;
    color: var(--primary);
    box-shadow: 0 0 16px rgba(10, 77, 255, 0.15);
}

[data-theme="dark"] .header__badge {
    animation: logoColorCycle 10s infinite ease-in-out;
}

@keyframes logoColorCycle {
    0%, 100% {
        color: #0A4DFF;
        border-color: rgba(10, 77, 255, 0.2);
        box-shadow: 0 0 16px rgba(10, 77, 255, 0.15);
    }
    25% {
        color: #A855F7;
        border-color: rgba(168, 85, 247, 0.2);
        box-shadow: 0 0 16px rgba(168, 85, 247, 0.15);
    }
    50% {
        color: #10B981;
        border-color: rgba(16, 185, 129, 0.2);
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
    }
    75% {
        color: #EF4444;
        border-color: rgba(239, 68, 68, 0.2);
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.15);
    }
}



/* Brand */
.header__brand {
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 12px;
}

[data-theme="dark"] .header__brand {
    /* Kept generic if needed, but removed original drop-shadow */
}

.brand-nxt {
    color: var(--text);
}

.brand-ca {
    background: linear-gradient(135deg, #5B21B6, #7C3AED, #A855F7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.25));
}



/* Title */
.header__title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* Subtitle */
.header__subtitle {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ==================================================
   7. DIVIDER
   ================================================== */

.divider {
    height: 1px;
    background: var(--border);
    margin: 36px 0 40px;
}

/* ==================================================
   8. FORM FIELDS
   ================================================== */

.field {
    margin-bottom: 28px;
}

/* Label */
.field__label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.required-star {
    color: var(--danger);
    margin-left: 4px;
}

.field__label i {
    color: var(--primary);
    width: 18px;
    text-align: center;
    font-size: 14px;
}

/* Input */
.field__input {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    font-size: 15px;
    color: var(--text);
    background: var(--input-bg, var(--card));
    border: 1.5px solid var(--border);
    border-radius: 14px;
    outline: none;
    transition: border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                background var(--duration) var(--ease);
}

.field__input::placeholder {
    color: var(--text-placeholder);
}

/* Fix Webkit Autofill Background */
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus,
.field__input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 50px var(--input-bg, var(--card)) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.field__input:hover {
    border-color: var(--border-hover);
}

.field__input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ghost);
}

/* Validation error state */
.field__input.error {
    border-color: var(--danger);
}

.field__input.error:focus {
    box-shadow: 0 0 0 4px var(--danger-ghost);
}

/* ==================================================
   9. GLASS DROPDOWN & SELECTION MODAL
   ================================================== */

/* Trigger */
.dropdown {
    position: relative;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--input-bg, var(--card));
    border: 1.5px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    outline: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    transition: border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                background var(--duration) var(--ease);
}

.dropdown:hover {
    border-color: var(--border-hover);
}

.dropdown:focus, .dropdown.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ghost);
}

.dropdown.error {
    border-color: var(--danger);
}

/* Selected text */
.dropdown__text {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-placeholder);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.dropdown.has-value .dropdown__text {
    color: var(--text);
    font-weight: 500;
}

/* Chevron */
.dropdown__chevron {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform var(--duration) var(--ease);
    pointer-events: none;
}

.dropdown.open .dropdown__chevron {
    transform: rotate(180deg);
}

/* Modal Container */
.selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration) var(--ease);
}

.selection-modal.open {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Overlay */
.selection-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .selection-modal__overlay {
    background: rgba(0, 0, 0, 0.6);
}

/* Modal Content */
.selection-modal__content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-toast);
    padding: 24px;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.selection-modal.open .selection-modal__content {
    transform: scale(1) translateY(0);
}

.selection-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.selection-modal__header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.selection-modal__close {
    background: var(--input-bg);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.selection-modal__close:hover {
    background: var(--border);
    color: var(--text);
}

/* Tab Group inside Modal */
.tab-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-btn {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.tab-btn:hover:not(.locked) {
    color: var(--text);
    background: var(--primary-ghost);
}

.tab-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-ghost);
}

.tab-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(10, 77, 255, 0.25);
    font-weight: 600;
}

.tab-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-placeholder);
    background: transparent;
}

.tab-btn.locked i {
    font-size: 11px;
}

/* ==================================================
   10. UPLOAD ZONE
   ================================================== */

.upload {
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    background: var(--upload-bg, var(--bg));
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border-color var(--duration) var(--ease),
                background var(--duration) var(--ease),
                transform var(--duration) var(--ease);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.upload:hover {
    border-color: var(--primary);
    background: var(--primary-ghost);
    transform: scale(1.02);
}

/* Drag-active state */
.upload.drag-active {
    border-color: var(--primary);
    background: rgba(10, 77, 255, 0.02);
    box-shadow: 0 0 0 4px var(--primary-ghost);
}

/* Error state */
.upload.error {
    border-color: var(--danger);
}

/* Cloud icon */
.upload__icon {
    font-size: 42px;
    color: var(--primary);
    margin-bottom: 14px;
}

/* Title */
.upload__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

/* Description */
.upload__desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* Divider text */
.upload__or {
    font-size: 13px;
    color: var(--text-placeholder);
    margin-bottom: 14px;
}

/* Browse button */
.upload__btn {
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 500;
    transition: background var(--duration) var(--ease);
    margin-bottom: 14px;
}

.upload__btn:hover {
    background: var(--primary-hover);
}

/* Limit text */
.upload__limit {
    font-size: 12px;
    color: var(--text-placeholder);
}

/* ==================================================
   11. FILE PREVIEW
   ================================================== */

.preview {
    display: none;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.preview.visible {
    display: block;
}

/* Top row */
.preview__row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

/* PDF icon */
.preview__icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--danger-ghost);
    flex-shrink: 0;
    font-size: 22px;
    color: var(--danger);
}

/* File info */
.preview__info {
    flex: 1;
    min-width: 0;
}

.preview__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.preview__size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Remove button */
.preview__remove {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-xs);
    background: var(--danger-ghost);
    color: var(--danger);
    font-size: 14px;
    flex-shrink: 0;
    transition: background var(--duration) var(--ease),
                color var(--duration) var(--ease);
}

.preview__remove:hover {
    background: var(--danger);
    color: #FFFFFF;
}

/* Progress track */
.preview__track {
    width: 100%;
    height: 5px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.preview__bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 80ms linear;
}

/* Ready status */
.preview__status {
    font-size: 13px;
    font-weight: 500;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.preview__status.visible {
    opacity: 1;
}

/* ==================================================
   12. DECLARATION CHECKBOX
   ================================================== */

.check {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    margin-bottom: 32px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hide native input */
.check__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom box */
.check__box {
    position: relative;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: 6px;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background var(--duration) var(--ease),
                border-color var(--duration) var(--ease);
}

/* Checked state */
.check__input:checked ~ .check__box {
    background: var(--primary);
    border-color: var(--primary);
}

/* SVG Checkmark */
.check__icon {
    width: 12px;
    height: 9px;
    stroke-dasharray: 16;
    stroke-dashoffset: 16;
    transition: stroke-dashoffset 200ms var(--ease);
}

.check__input:checked ~ .check__box .check__icon {
    stroke-dashoffset: 0;
}

/* Error highlight */
.check.error .check__box {
    border-color: var(--danger);
}

/* Text */
.check__text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.terms-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

/* ==================================================
   13. SUBMIT BUTTON
   ================================================== */

.btn-submit {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(10, 77, 255, 0.25), 0 1px 2px rgba(255, 255, 255, 0.15) inset;
    transition: background 250ms var(--ease),
                transform 250ms var(--ease),
                box-shadow 250ms var(--ease);
}

.btn-submit:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(10, 77, 255, 0.30), 0 1px 2px rgba(255, 255, 255, 0.15) inset;
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: scale(0.97) translateY(0);
}

/* Loading state */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-submit.loading .btn-submit__label {
    display: none;
}

/* Spinner */
.btn-submit__spinner {
    display: none;
}

.btn-submit.loading .btn-submit__spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================================================
   14. TRUST BAR
   ================================================== */

/* Trust section */
.trust {
    margin-top: 48px;
    text-align: center;
}

.trust__primary {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 16px;
}

.trust__primary i {
    font-size: 13px;
    margin-right: 4px;
    color: #475569;
}

.trust__secondary {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.trust__copyright {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-placeholder);
    line-height: 1.5;
}

/* ==================================================
   15. TOAST NOTIFICATIONS
   ================================================== */

.toast-rack {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-toast);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.3s var(--ease);
    border-left: 4px solid var(--primary);
}

.toast.show {
    transform: translateX(0);
}

.toast i {
    font-size: 16px;
    flex-shrink: 0;
}

/* Variants */
.toast--success {
    border-left-color: var(--success);
}

.toast--success i {
    color: var(--success);
}

.toast--error {
    border-left-color: var(--danger);
}

.toast--error i {
    color: var(--danger);
}

.toast--warning {
    border-left-color: var(--warning);
}

.toast--warning i {
    color: var(--warning);
}

/* ==================================================
   16. SUCCESS VIEW
   ================================================== */

.success {
    text-align: center;
}

/* Animation Container */
.success__animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge */
.success__badge-lg {
    position: relative;
    z-index: 2;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--success);
    font-size: 38px;
    color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.25);
    transform: scale(0);
}

.success.animate .success__badge-lg {
    animation: successBadge 700ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               successBadgePulse 5s ease-in-out infinite 700ms;
}

@keyframes successBadge {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes successBadgePulse {
    0%, 100% { box-shadow: 0 0 0px rgba(var(--primary-rgb, 10, 77, 255), 0); }
    50% { box-shadow: 0 0 20px rgba(var(--primary-rgb, 10, 77, 255), 0.4); }
}

/* Rings */
.success__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--success);
    opacity: 0;
}

.success.animate .success__ring--1 {
    animation: successRing 800ms ease-out 100ms forwards;
}

.success.animate .success__ring--2 {
    animation: successRing 900ms ease-out 250ms forwards;
}

@keyframes successRing {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Custom Particles Container */
#successParticles {
    position: absolute;
    inset: -100px;
    pointer-events: none;
    z-index: 10;
}

.nxt-particle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.success__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.success__subtitle {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.success__desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
}

.success__footer-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Details table container */
.success__table-container {
    margin-bottom: 32px;
}

/* Details table */
.success__table {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.success__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.success__row + .success__row {
    border-top: 1px solid var(--border);
}

.success__key {
    font-size: 14px;
    color: var(--text-secondary);
}

.success__val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* Success Actions */
.success__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
}

/* Fade Up Sequences */
.success__fade {
    opacity: 0;
    transform: translateY(12px);
}

.success.animate .success__fade {
    animation: successFadeUp 0.5s var(--ease) forwards;
}

/* Sequence Delays */
.success.animate .success__title.success__fade { animation-delay: 500ms; }
.success.animate .success__subtitle.success__fade { animation-delay: 650ms; }
.success.animate .success__desc.success__fade { animation-delay: 800ms; }
.success.animate .success__table-container.success__fade { animation-delay: 950ms; }
.success.animate .success__footer-text.success__fade { animation-delay: 1100ms; }
.success.animate #btnAnother.success__fade { animation-delay: 1250ms; }
.success.animate #btnClose.success__fade { animation-delay: 1400ms; }

@keyframes successFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Minimal Text Button */
.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px;
    cursor: pointer;
    transition: color var(--duration) var(--ease);
}

.btn-text:hover {
    color: var(--text);
    text-decoration: underline;
}

/* ==================================================
   17. PROCESSING VIEW
   ================================================== */

.processing {
    padding: 0;
    overflow: hidden;
}

.processing__header {
    padding: 48px 40px 32px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    background: radial-gradient(circle at top, rgba(255,255,255,0.02) 0%, transparent 70%);
}

[data-theme="dark"] .processing__header {
    background: radial-gradient(circle at top, rgba(255,255,255,0.015) 0%, transparent 70%);
}

.processing__badge {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    animation: processingCapFloat 4s ease-in-out infinite;
}

.processing__aurora {
    position: absolute;
    inset: -60px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(10, 77, 255, 0.15) 0%, rgba(139, 92, 246, 0.1) 40%, rgba(6, 182, 212, 0.05) 70%, transparent 100%);
    filter: blur(20px);
    z-index: -1;
    opacity: 0;
    transition: opacity 450ms ease, background 1.5s ease;
    animation: processingAuroraFloat 12s ease-in-out infinite alternate;
}

:root[data-theme="dark"] .processing__aurora {
    opacity: 1;
}

.processing__aurora.success-transition {
    background: radial-gradient(circle at center, rgba(22, 163, 74, 0.25) 0%, rgba(34, 197, 94, 0.15) 40%, rgba(74, 222, 128, 0.05) 70%, transparent 100%);
}

@keyframes processingCapFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes processingAuroraFloat {
    0% { transform: scale(1) translate(0, 0); opacity: 0.8; }
    33% { transform: scale(1.1) translate(5px, -5px); opacity: 1; }
    66% { transform: scale(0.95) translate(-5px, 5px); opacity: 0.9; }
    100% { transform: scale(1.05) translate(3px, 3px); opacity: 1; }
}

.processing__icon {
    font-size: 34px;
    color: var(--primary);
    transition: all 0.4s ease;
}

.processing__icon.success-icon {
    color: var(--success);
    transform: scale(1.2);
}

.processing__title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.processing__subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

.processing__id-box {
    margin-top: 24px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--input-bg, var(--bg));
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.processing__id-box.visible {
    opacity: 1;
    transform: translateY(0);
}

.processing__id-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-placeholder);
    margin-bottom: 2px;
}

.processing__id-val {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    font-family: monospace;
    letter-spacing: 0.5px;
}

.processing__workflow {
    padding: 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 380px;
    margin: 0 auto;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0.4;
    transition: opacity 0.4s var(--ease);
}

.workflow-step.active {
    opacity: 1;
}

.workflow-step.completed {
    opacity: 1;
}

.workflow-step__icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--text-placeholder);
    transition: color 0.3s var(--ease), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.workflow-step.active .workflow-step__icon {
    color: var(--primary);
}

.workflow-step.completed .workflow-step__icon {
    color: var(--success);
    transform: scale(1.1);
}

.workflow-step__text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.processing__message {
    text-align: center;
    padding: 0 40px 40px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.processing__message p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: opacity 0.6s ease-in-out;
    opacity: 1;
}

.processing__trust {
    border-top: 1px solid var(--border);
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: var(--input-bg, var(--bg));
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.trust-item i {
    font-size: 14px;
    color: var(--text-placeholder);
}

@media (max-width: 768px) {
    .processing__trust {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* ==================================================
   17. TOOLTIPS
   ================================================== */

.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    margin-left: 6px;
    color: var(--text-placeholder);
    transition: color var(--duration) var(--ease);
}

.tooltip-container:hover {
    color: var(--primary);
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: var(--shadow);
    transition: opacity var(--duration) var(--ease),
                transform var(--duration) var(--ease);
    z-index: 100;
    margin-bottom: 8px;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.85) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-content {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================================================
   18. DARK MODE TOGGLE
   ================================================== */
.theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid var(--border);
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    z-index: 50;
    transition: transform var(--duration) var(--ease);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ==================================================
   19. RESPONSIVE
   ================================================== */

@media (max-width: 768px) {

    .page {
        padding: 32px 16px;
    }

    .card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    /* Header */
    .header__brand {
        font-size: 40px;
    }

    .header__title {
        font-size: 19px;
    }

    /* Inputs */
    .field__input {
        height: 52px;
    }

    /* Dropdown */
    .dropdown {
        height: 52px;
        border-radius: var(--radius-sm);
    }

    .dropdown__menu {
        border-radius: 14px;
    }

    .dropdown__option {
        height: 44px;
        border-radius: 10px;
    }

    /* Upload */
    .upload {
        padding: 28px 16px;
    }

    /* Submit */
    .btn-submit {
        height: 52px;
    }

    /* Trust bar */
    .trust {
        flex-direction: column;
    }

    /* Success */
    .success__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 14px 20px;
    }

    .success__val {
        text-align: left;
    }
}

@media (max-width: 480px) {

    .card {
        padding: 28px 18px;
    }

    .upload-view__desc {
        font-size: 14px;
        max-width: 280px;
        margin: 0 auto 36px;
    }

    .header__badge {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .header__brand {
        font-size: 34px;
    }

    .header__title {
        font-size: 17px;
    }

    .header__subtitle {
        font-size: 13px;
    }

    .toast-rack {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* ==================================================
   20. MODAL (TERMS & CONDITIONS)
   ================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms var(--ease), visibility 250ms var(--ease);
}

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

.modal-container {
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(10px);
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 10;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.modal-close {
    background: var(--input-bg, var(--bg));
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: transform 200ms var(--ease), color 200ms var(--ease);
}

.modal-close:hover {
    color: var(--text);
    transform: scale(1.05);
}

.modal-content-area {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.modal-content-area::-webkit-scrollbar {
    width: 6px;
}
.modal-content-area::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.modal-section {
    margin-bottom: 28px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    background: var(--card);
    position: sticky;
    bottom: 0;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}

.modal-footer-text {
    font-size: 13px;
    color: var(--text-placeholder);
    text-align: center;
}

@media (max-width: 480px) {
    .modal-header, .modal-footer, .modal-content-area {
        padding: 20px;
    }
    .page {
        padding: 16px;
    }
    .card {
        padding: 24px 20px;
    }
    .success__animation {
        width: 80px;
        height: 80px;
        margin-bottom: 16px;
    }
    .success__title {
        font-size: 24px;
        white-space: nowrap;
    }
}
