/* ==========================================================================
   DpNEx Public Stylesheet
   Brand: Yellow #FFD700 | Dark Blue #1B2A6B | Dark Red #8B1A1A
   ========================================================================== */

/* ── Reset / Base ──────────────────────────────────────────────────────────── */
.dpnex-wrap *,
.dpnex-wrap *::before,
.dpnex-wrap *::after {
    box-sizing: border-box;
}

.dpnex-wrap {
    max-width: 860px;
    margin: 0 auto 40px;
    font-family: inherit;
    color: #333;
    line-height: 1.6;
}

/* ── Progress Bar ──────────────────────────────────────────────────────────── */
.dpnex-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 36px;
    gap: 0;
}

.dpnex-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    flex: 0 0 auto;
}

.dpnex-step-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ddd;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: background 0.25s, color 0.25s;
}

.dpnex-step-label {
    font-size: 12px;
    color: #777;
    font-weight: 500;
    text-align: center;
    transition: color 0.25s;
}

.dpnex-progress-step.dpnex-progress-active .dpnex-step-num {
    background: #1B2A6B;
    color: #fff;
}

.dpnex-progress-step.dpnex-progress-active .dpnex-step-label {
    color: #1B2A6B;
    font-weight: 700;
}

.dpnex-progress-step.dpnex-progress-completed .dpnex-step-num {
    background: #FFD700;
    color: #1B2A6B;
}

.dpnex-progress-step.dpnex-progress-completed .dpnex-step-label {
    color: #555;
}

.dpnex-progress-divider {
    flex: 1;
    height: 3px;
    background: #ddd;
    max-width: 100px;
    margin: 0 8px;
    margin-bottom: 20px;
    transition: background 0.25s;
}

.dpnex-progress-divider.dpnex-divider-done {
    background: #FFD700;
}

/* ── Steps ─────────────────────────────────────────────────────────────────── */
.dpnex-step {
    display: none;
}

.dpnex-step.dpnex-step-active {
    display: block;
}

.dpnex-step-title {
    color: #1B2A6B;
    font-size: 22px;
    margin: 0 0 20px;
    border-bottom: 3px solid #FFD700;
    padding-bottom: 10px;
}

/* ── Fieldsets ─────────────────────────────────────────────────────────────── */
.dpnex-fieldset {
    border: 1px solid #d0d5e8;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 20px;
    background: #fafbff;
}

.dpnex-fieldset legend {
    font-weight: 700;
    color: #1B2A6B;
    padding: 0 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Form Grid ─────────────────────────────────────────────────────────────── */
.dpnex-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ── Fields ────────────────────────────────────────────────────────────────── */
.dpnex-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dpnex-field label {
    font-weight: 600;
    font-size: 13px;
    color: #2a2a2a;
}

.dpnex-required {
    color: #8B1A1A;
    font-weight: 700;
}

.dpnex-input,
.dpnex-wrap input[type="text"],
.dpnex-wrap input[type="email"],
.dpnex-wrap input[type="tel"],
.dpnex-wrap input[type="number"],
.dpnex-wrap input[type="password"],
.dpnex-wrap select,
.dpnex-wrap textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #c8cfe8;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.dpnex-input:focus,
.dpnex-wrap input:focus,
.dpnex-wrap select:focus,
.dpnex-wrap textarea:focus {
    border-color: #1B2A6B;
    box-shadow: 0 0 0 3px rgba(27, 42, 107, 0.12);
}

.dpnex-wrap textarea {
    resize: vertical;
    min-height: 80px;
}

.dpnex-field.dpnex-field-error .dpnex-input,
.dpnex-field.dpnex-field-error input,
.dpnex-field.dpnex-field-error select,
.dpnex-field.dpnex-field-error textarea {
    border-color: #8B1A1A;
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.1);
}

.dpnex-field-error-msg {
    font-size: 12px;
    color: #8B1A1A;
    margin-top: 2px;
}

/* ── Price Display ─────────────────────────────────────────────────────────── */
.dpnex-price-display {
    background: linear-gradient(135deg, #fffbe6 0%, #fff8cc 100%);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 20px 0;
}

.dpnex-price-heading {
    color: #1B2A6B;
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid rgba(27,42,107,0.15);
    padding-bottom: 8px;
}

.dpnex-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 14px;
    color: #444;
}

.dpnex-price-row + .dpnex-price-row {
    border-top: 1px solid rgba(0,0,0,0.05);
}

.dpnex-price-total {
    font-weight: 700;
    font-size: 18px;
    color: #1B2A6B;
    border-top: 2px solid #FFD700 !important;
    margin-top: 8px;
    padding-top: 10px !important;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.dpnex-btn {
    display: inline-block;
    background: #1B2A6B;
    color: #fff;
    border: 2px solid #1B2A6B;
    padding: 11px 26px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1.4;
    font-family: inherit;
}

.dpnex-btn:hover,
.dpnex-btn:focus {
    background: #FFD700;
    color: #1B2A6B;
    border-color: #FFD700;
    text-decoration: none;
}

.dpnex-btn-outline {
    background: transparent;
    color: #1B2A6B;
    border-color: #1B2A6B;
}

.dpnex-btn-outline:hover,
.dpnex-btn-outline:focus {
    background: #1B2A6B;
    color: #fff;
}

.dpnex-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.dpnex-btn-danger {
    background: #8B1A1A;
    border-color: #8B1A1A;
    color: #fff;
}

.dpnex-btn-danger:hover {
    background: #a32020;
    border-color: #a32020;
    color: #fff;
}

.dpnex-step-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ── Notices ───────────────────────────────────────────────────────────────── */
.dpnex-notice {
    padding: 13px 18px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid transparent;
}

.dpnex-notice-success,
.dpnex-notice.dpnex-notice-success {
    background: #edfaed;
    border-color: #2da44e;
    color: #1a5e2a;
}

.dpnex-notice-error,
.dpnex-notice.dpnex-notice-error {
    background: #fce8e6;
    border-color: #8B1A1A;
    color: #8B1A1A;
}

.dpnex-notice-info,
.dpnex-notice.dpnex-notice-info {
    background: #eaf0ff;
    border-color: #1B2A6B;
    color: #1B2A6B;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.dpnex-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dpnex-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

.dpnex-loading-spinner {
    text-align: center;
    padding: 24px;
    color: #555;
    font-size: 14px;
}

.dpnex-loading-spinner .dpnex-spinner {
    border-color: rgba(27,42,107,0.3);
    border-top-color: #1B2A6B;
    width: 24px;
    height: 24px;
}

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

/* ── Status Badges ─────────────────────────────────────────────────────────── */
.dpnex-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.dpnex-status-pending          { background: #fff3cd; color: #856404; }
.dpnex-status-confirmed        { background: #dce6ff; color: #1B2A6B; }
.dpnex-status-collected        { background: #e8d5f5; color: #5b2d8e; }
.dpnex-status-in_transit       { background: #cfe2ff; color: #084298; }
.dpnex-status-out_for_delivery { background: #ffe5cc; color: #7a3a00; }
.dpnex-status-delivered        { background: #d4edda; color: #155724; }
.dpnex-status-cancelled        { background: #f8d7da; color: #721c24; }

/* ── Bookings Table ────────────────────────────────────────────────────────── */
.dpnex-bookings-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dpnex-bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

.dpnex-bookings-table th {
    background: #1B2A6B;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.dpnex-bookings-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eef0f7;
    vertical-align: middle;
}

.dpnex-bookings-table tbody tr:hover {
    background: #f4f6ff;
}

.dpnex-link {
    color: #1B2A6B;
    text-decoration: none;
    font-weight: 600;
}

.dpnex-link:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* ── Timeline (Track Shipment) ─────────────────────────────────────────────── */
.dpnex-track-wrap h2 {
    color: #1B2A6B;
    border-bottom: 3px solid #FFD700;
    padding-bottom: 10px;
}

.dpnex-track-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.dpnex-track-field {
    flex: 1;
    min-width: 220px;
}

.dpnex-track-result {
    background: #fafbff;
    border: 1px solid #d0d5e8;
    border-radius: 8px;
    padding: 24px;
    margin-top: 16px;
}

.dpnex-track-ref-label {
    color: #1B2A6B;
    font-weight: 700;
}

.dpnex-track-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 14px 0 20px;
    font-size: 14px;
}

.dpnex-timeline {
    padding: 16px 0;
}

.dpnex-timeline-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    position: relative;
    font-size: 14px;
    color: #888;
}

.dpnex-timeline-item + .dpnex-timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: -10px;
    width: 2px;
    height: 10px;
    background: #ddd;
}

.dpnex-timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    transition: background 0.2s;
}

.dpnex-timeline-item.dpnex-timeline-done .dpnex-timeline-dot {
    background: #1B2A6B;
    color: #FFD700;
}

.dpnex-timeline-item.dpnex-timeline-active .dpnex-timeline-dot {
    background: #FFD700;
    color: #1B2A6B;
    font-size: 14px;
    font-weight: 700;
}

.dpnex-timeline-item.dpnex-timeline-done .dpnex-timeline-label {
    color: #1B2A6B;
    font-weight: 600;
}

.dpnex-timeline-item.dpnex-timeline-active .dpnex-timeline-label {
    color: #1B2A6B;
    font-weight: 700;
}

.dpnex-track-current-status {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

/* ── Confirmation Page ─────────────────────────────────────────────────────── */
.dpnex-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.dpnex-confirm-icon {
    width: 72px;
    height: 72px;
    background: #2da44e;
    color: #fff;
    border-radius: 50%;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-weight: 700;
}

.dpnex-confirm-title {
    color: #1B2A6B;
    font-size: 28px;
    margin: 0 0 8px;
}

.dpnex-confirm-subtitle {
    color: #555;
    font-size: 16px;
    margin-bottom: 24px;
}

.dpnex-confirm-ref-box {
    background: #1B2A6B;
    color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 0 auto 24px;
    max-width: 360px;
}

.dpnex-confirm-ref-box p {
    margin: 0 0 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.dpnex-confirm-ref {
    font-size: 24px;
    font-weight: 700;
    color: #FFD700;
    letter-spacing: 2px;
}

.dpnex-confirm-details {
    text-align: left;
    max-width: 480px;
    margin: 0 auto 24px;
}

.dpnex-confirm-details h3 {
    color: #1B2A6B;
    border-bottom: 2px solid #FFD700;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.dpnex-confirm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dpnex-confirm-table th {
    text-align: left;
    padding: 7px 10px;
    color: #555;
    font-weight: 600;
    width: 38%;
    background: #f4f6ff;
}

.dpnex-confirm-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
}

.dpnex-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dpnex-confirm-contact {
    color: #555;
    font-size: 13px;
}

.dpnex-confirm-contact a {
    color: #1B2A6B;
    font-weight: 600;
}

/* ── Account / Auth Tabs ───────────────────────────────────────────────────── */
.dpnex-account-wrap {
    max-width: 680px;
}

.dpnex-account-tabs {
    display: flex;
    border-bottom: 2px solid #1B2A6B;
    margin-bottom: 24px;
}

.dpnex-tab {
    padding: 10px 24px;
    font-weight: 600;
    font-size: 15px;
    color: #555;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.dpnex-tab:hover {
    color: #1B2A6B;
    text-decoration: none;
}

.dpnex-tab-active {
    color: #1B2A6B;
    border-bottom-color: #FFD700;
}

.dpnex-auth-form {
    max-width: 480px;
}

.dpnex-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.dpnex-account-header h2 {
    margin: 0;
    color: #1B2A6B;
}

.dpnex-account-quicklinks {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.dpnex-account-section {
    margin-bottom: 32px;
}

.dpnex-account-section h3 {
    color: #1B2A6B;
    border-bottom: 2px solid #FFD700;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* ── Address Cards ─────────────────────────────────────────────────────────── */
.dpnex-address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dpnex-address-card {
    border: 1.5px solid #d0d5e8;
    border-radius: 6px;
    padding: 16px;
    background: #fafbff;
    font-size: 13px;
}

.dpnex-address-card p {
    margin: 3px 0;
    color: #444;
}

.dpnex-address-card-label {
    font-weight: 700;
    color: #1B2A6B;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dpnex-default-badge {
    background: #FFD700;
    color: #1B2A6B;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.dpnex-address-actions {
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.dpnex-add-address-toggle {
    margin-top: 16px;
}

.dpnex-add-address-toggle summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
}

.dpnex-add-address-toggle summary::-webkit-details-marker {
    display: none;
}

.dpnex-muted {
    color: #888;
    font-style: italic;
}

.dpnex-field-inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.dpnex-field-inline label {
    font-weight: 400;
    cursor: pointer;
}

/* ── Saved Address Loader ──────────────────────────────────────────────────── */
.dpnex-saved-address-loader {
    background: #eaf0ff;
    border: 1px solid #c0ccf0;
    border-radius: 5px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}

.dpnex-saved-address-loader label {
    font-weight: 600;
    color: #1B2A6B;
    white-space: nowrap;
}

.dpnex-saved-address-loader select {
    flex: 1;
    min-width: 180px;
}

/* ── Stripe Payment Element ────────────────────────────────────────────────── */
#dpnex-payment-element-wrap {
    margin: 20px 0;
    min-height: 100px;
}

#dpnex-payment-element {
    padding: 4px 0;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .dpnex-form-grid {
        grid-template-columns: 1fr;
    }

    .dpnex-progress-divider {
        max-width: 40px;
    }

    .dpnex-step-num {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .dpnex-step-label {
        font-size: 11px;
    }

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

    .dpnex-fieldset {
        padding: 14px 14px;
    }

    .dpnex-confirm-title {
        font-size: 22px;
    }

    .dpnex-confirm-ref {
        font-size: 18px;
    }

    .dpnex-track-info-grid {
        grid-template-columns: 1fr;
    }

    .dpnex-bookings-table th,
    .dpnex-bookings-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .dpnex-account-tabs {
        flex-wrap: wrap;
    }

    .dpnex-tab {
        padding: 8px 16px;
        font-size: 14px;
    }

    .dpnex-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .dpnex-step-actions {
        flex-direction: column;
    }

    .dpnex-step-actions .dpnex-btn {
        width: 100%;
        text-align: center;
    }

    .dpnex-confirm-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .dpnex-wrap {
        padding: 0 4px;
    }

    .dpnex-address-grid {
        grid-template-columns: 1fr;
    }

    .dpnex-progress {
        gap: 2px;
    }

    .dpnex-progress-divider {
        max-width: 24px;
    }
}
