:root {
    --primary: #0073e6;
    --primary-hover: #005bb5;
    --bg-top: #2196f3;
    --bg-bottom: #90caf9;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-color: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --error: #ef4444;
}

html {
    background-color: var(--bg-bottom);
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior-y: contain;
    /* Prevents bottom bounce, allows pull-to-refresh on Android */
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    color: var(--text-color);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

h1 {
    text-align: center;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 28px;
    color: #ffffff;
}

p.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-size: 15px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: var(--text-color);
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

input[type="text"]:disabled,
input[type="text"]:read-only {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: #cbd5e1;
    opacity: 0.8;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 115, 230, 0.15);
}

input[type="text"].vibrate-error {
    border-color: #ef4444 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25) !important;
    animation: fieldShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.drop-zone {
    display: block;
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
    backdrop-filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
}

.drop-zone:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.drop-zone * {
    pointer-events: none;
}

.drop-zone.vibrate-error {
    animation: dropZoneVibrate 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    border-color: #ef4444 !important;
    border-style: solid !important;
    background: rgba(239, 68, 68, 0.15) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3), 0 8px 24px rgba(239, 68, 68, 0.2) !important;
}

.drop-zone.vibrate-error .drop-zone-icon {
    animation: iconBounce 0.6s ease;
}

.drop-zone-wrapper {
    margin-bottom: 24px;
}

.drop-zone-wrapper .drop-zone {
    margin-bottom: 0;
}

.field-error-msg {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        margin 0.3s ease;
    color: #ffe4e6;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
    margin-top: 0;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.field-error-msg.show {
    max-height: 50px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 8px;
}

@keyframes dropZoneVibrate {

    0%,
    100% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-9px) rotate(-1deg);
    }

    30% {
        transform: translateX(8px) rotate(1deg);
    }

    45% {
        transform: translateX(-6px) rotate(-0.5deg);
    }

    60% {
        transform: translateX(5px) rotate(0.5deg);
    }

    75% {
        transform: translateX(-3px);
    }

    90% {
        transform: translateX(2px);
    }
}

@keyframes fieldShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(7px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(4px);
    }
}

@keyframes iconBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25) rotate(12deg);
    }
}

.drop-zone:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.drop-zone.dragover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.drop-zone-prompt {
    display: block;
    pointer-events: none;
}

.drop-zone.has-file {
    border-style: solid !important;
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.15) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    padding: 24px 20px !important;
}

.drop-zone.has-file .drop-zone-prompt {
    display: none !important;
}

.drop-zone.has-file .selected-file-card {
    display: flex !important;
}

.selected-file-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.selected-file-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 2px;
    animation: fileIconPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fileIconPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.selected-file-info {
    text-align: center;
    max-width: 100%;
}

.selected-file-name {
    font-size: 16.5px;
    font-weight: 700;
    color: #ffffff;
    word-break: break-all;
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.selected-file-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.selected-file-size {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.25);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.selected-file-badge {
    font-size: 12px;
    font-weight: 700;
    color: #064e3b;
    background: #a7f3d0;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
}

.selected-file-change-hint {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.drop-zone:hover .selected-file-change-hint {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.drop-zone-text {
    font-size: 16px;
    color: #ffffff;
    pointer-events: none;
}

.drop-zone-icon {
    font-size: 36px;
    margin-bottom: 12px;
    color: #ffffff;
    pointer-events: none;
}

#fileInput {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: #d7ff3c;
    color: #000000;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
    background: #ccf627;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.8;
}

.submit-container {
    width: 100%;
}

/* ── Unified Dedicated Processing View (Plain Surface) ── */
.processing-card {
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 16px 0;
    text-align: center;
    box-shadow: none;
    animation: fadeIn 0.4s ease forwards;
}

.processing-icon-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: #d7ff3c;
    animation: spin 0.9s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #d7ff3c 0%, #a3e635 100%);
    width: 0%;
    transition: width 0.08s linear;
    border-radius: 15px;
    box-shadow: 0 0 14px rgba(215, 255, 60, 0.7);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: 'Outfit', sans-serif;
    pointer-events: none;
}

.progress-status-msg {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
}

.progress-sub-msg {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ── Leave Page Notices (Clean Plain Surface Text) ── */
.progress-leave-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    background: transparent;
    border: none;
    box-shadow: none;
}

.progress-leave-notice.notice-uploading {
    color: #fef08a;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: transparent;
    border: none;
    box-shadow: none;
}

.progress-leave-notice.notice-processing {
    color: #dcfce7;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: transparent;
    border: none;
    box-shadow: none;
}

.cancel-upload-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-upload-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
}

/* ── Success View (Plain Surface) ── */
.success-card {
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 24px 0;
    text-align: center;
    box-shadow: none;
    animation: fadeIn 0.5s ease forwards;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 18px;
    animation: iconBounce 1s ease;
}

.success-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 12px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.success-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto 20px auto;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.success-safe-badge {
    display: inline-block;
    color: #dcfce7;
    font-size: 14.5px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

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

.message-box {
    margin-top: 24px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    display: none;
    line-height: 1.5;
    animation: fadeIn 0.3s ease forwards;
    font-weight: 600;
    text-align: center;
}

.message-box.success {
    display: block;
    background: rgba(236, 253, 245, 0.95);
    border: 1px solid #10b981;
    color: #065f46;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.message-box.error {
    display: block;
    background: rgba(254, 242, 242, 0.95);
    border: 1px solid #ef4444;
    color: #991b1b;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Custom Modal CSS */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.custom-modal-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.2s ease;
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
}

.custom-modal-overlay.show .custom-modal-box {
    transform: scale(1);
}

.custom-modal-box h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
}

.custom-modal-box p {
    margin-bottom: 24px;
    font-size: 15px;
    color: #64748b;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: opacity 0.2s ease;
}

.modal-btn:hover {
    opacity: 0.8;
}

.modal-btn-cancel {
    background: #e2e8f0;
    color: #475569;
}

.modal-btn-confirm {
    background: #ef4444;
    color: #ffffff;
}

/* Delivery Address Dialog Modal */
.address-modal-box {
    background: #ffffff;
    padding: 28px;
    border-radius: 20px;
    width: 92%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    text-align: left;
}

.address-modal-box h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.address-modal-box .modal-sub {
    margin-bottom: 20px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.address-modal-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.address-modal-box .opt-label {
    font-weight: 400;
    color: #64748b;
    font-size: 12px;
}

.form-group-field {
    margin-bottom: 12px;
}

.address-modal-box input,
.address-modal-box select {
    width: 100%;
    padding: 11px 14px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.address-modal-box input:focus,
.address-modal-box select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.address-modal-box input.has-error,
.address-modal-box select.has-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

.field-error-msg {
    display: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    margin-top: 3px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.address-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Order ID Label with Helper '?' Button */
.order-id-label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    line-height: 1;
}

.order-id-label-wrap label {
    margin-bottom: 0;
    display: inline-block;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 14px;
}

.order-id-help-btn {
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    color: var(--primary, #0073e6);
    font-size: 10px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin: 0;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.order-id-help-btn:hover {
    background: #ffffff;
    color: #005bb5;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 115, 230, 0.45);
}

.order-id-help-btn:active {
    transform: scale(0.92);
}

.order-id-help-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Amazon Order ID Guide Modal Box */
.order-help-modal-box {
    background: #ffffff;
    padding: 20px 22px 18px;
    border-radius: 20px;
    width: 92%;
    max-width: 410px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    text-align: left;
    box-sizing: border-box;
    transform: scale(0.94) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.custom-modal-overlay.show .order-help-modal-box {
    transform: scale(1) translateY(0);
}

.order-help-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.order-help-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.order-help-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.order-help-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -6px 0 0;
    border-radius: 8px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-help-close-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.order-help-body {
    overflow: visible;
    padding: 6px 8px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.order-help-img-frame {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 340px;
    background: #ffffff;
}

.order-help-img-frame img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.order-help-footer {
    margin-top: 0;
    padding-top: 4px;
    text-align: center;
}

.order-help-caption {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    line-height: 1.4;
}