/**
 * Frontend Styles for Travel Insurance Manager
 * Color scheme optimized for travel website integration
 */

:root {
    /* Cherieshed Travel Color Palette */
    --tim-primary: #3B754A;
    --tim-primary-dark: #2B2C2B;
    --tim-primary-light: #5C9474;
    --tim-secondary: #8D9C57;
    --tim-accent: #E0C662;
    --tim-accent-dark: #7A743E;
    --tim-success: #5C9474;
    --tim-error: #d32f2f;
    --tim-warning: #E0C662;
    --tim-text: #2B2C2B;
    --tim-text-light: #5C9474;
    --tim-border: #d1d5db;
    --tim-bg: #ffffff;
    --tim-bg-light: #f8f9fa;
    --tim-bg-hover: #e9ecef;
}

.tim-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border: 1px solid var(--tim-border);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tim-step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 25px 0;
    border-bottom: 2px solid var(--tim-border);
    position: relative;
}

.tim-step {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--tim-bg-light);
    color: var(--tim-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    border: 2px solid var(--tim-border);
    transition: all 0.3s ease;
}

.tim-step.active {
    background: var(--tim-primary);
    color: #fff;
    border-color: var(--tim-primary);
    box-shadow: 0 4px 12px rgba(59, 117, 74, 0.3);
}

.tim-step.completed {
    background: var(--tim-success);
    color: #fff;
    border-color: var(--tim-success);
    font-size: 0;
    line-height: 0;
}

.tim-step.completed::after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    line-height: 1;
}

.tim-form {
    margin-top: 20px;
}

.tim-form-group {
    margin-bottom: 20px;
}

.tim-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--tim-text);
    font-size: 14px;
}

.tim-form-group .required {
    color: var(--tim-error);
}

.tim-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--tim-border);
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    color: var(--tim-text);
    background: var(--tim-bg);
}

.tim-input:focus {
    border-color: var(--tim-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 117, 74, 0.1);
}

.tim-input.tim-error {
    border-color: var(--tim-error);
}

.tim-input.tim-error:focus {
    border-color: var(--tim-error);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.tim-input.tim-input-readonly,
.tim-input[readonly] {
    background-color: #f5f5f5;
    color: #666;
    cursor: default;
}

.tim-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tim-departure-arrival {
    grid-template-columns: 1fr 1fr;
}

.tim-field-destination .tim-input {
    font-size: 16px;
}

/* Age range checkboxes (Step 1) */
.tim-age-brackets {
    border: 1px solid var(--tim-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0;
    background: var(--tim-bg-light);
}

.tim-age-brackets legend {
    font-weight: 600;
    color: var(--tim-text);
    font-size: 14px;
    padding: 0 8px;
}

.tim-age-brackets-desc {
    font-size: 13px;
    color: var(--tim-text-light);
    margin: 6px 0 12px 0;
    line-height: 1.5;
}

.tim-age-brackets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.tim-age-bracket-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--tim-text);
}

.tim-age-bracket-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tim-primary);
    cursor: pointer;
}

.tim-age-bracket-item:hover {
    color: var(--tim-primary);
}

.tim-form-actions {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid var(--tim-border);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.tim-button {
    display: inline-block;
    padding: 12px 28px;
    background: var(--tim-bg-light);
    color: var(--tim-text);
    text-decoration: none;
    border: 2px solid var(--tim-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tim-button:hover {
    background: var(--tim-bg-hover);
    border-color: var(--tim-text-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tim-button-primary {
    background: var(--tim-primary);
    color: #fff;
    border-color: var(--tim-primary);
}

.tim-button-primary:hover {
    background: var(--tim-primary-dark);
    border-color: var(--tim-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 117, 74, 0.3);
}

.tim-button-block {
    width: 100%;
    text-align: center;
}

/* Step 2 description */
.tim-step2-desc {
    margin: 0 0 20px 0;
    color: var(--tim-text-light);
    font-size: 14px;
}

.tim-policy-block {
    margin-bottom: 28px;
}

.tim-policy-block-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: var(--tim-primary);
    border-bottom: 2px solid var(--tim-primary);
    padding-bottom: 8px;
}

.tim-policy-block-hint {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--tim-text-light);
}

/* Step 2: Policy selection by bracket */
#tim-step2-policy-form .tim-policy-bracket-group {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tim-border);
}
#tim-step2-policy-form .tim-policy-bracket-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}
#tim-step2-policy-form .tim-policy-bracket-title {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    color: var(--tim-primary-dark);
}

/* Horizontal policy cards (Step 2) */
.tim-policy-cards-horizontal {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tim-policy-card-h {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    background: #fff;
    transition: filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.tim-policy-card-h.tim-policy-card-h-unselected {
    filter: grayscale(100%);
    opacity: 0.85;
}

.tim-policy-card-h:not(.tim-policy-card-h-unselected) {
    border-color: var(--tim-primary-light);
    box-shadow: 0 2px 12px rgba(59, 117, 74, 0.12);
}

.tim-policy-card-h-col {
    padding: 14px 16px;
    box-sizing: border-box;
}

.tim-policy-card-h-image {
    flex: 0 0 100px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tim-bg-light);
}

.tim-policy-card-h-image img {
    max-width: 90px;
    max-height: 70px;
    object-fit: contain;
}

.tim-policy-card-h-noimg {
    font-size: 12px;
    color: var(--tim-text-light);
    text-align: center;
    padding: 0 6px;
}

.tim-policy-card-h-content {
    flex: 1 1 280px;
    min-width: 0;
}

.tim-policy-card-h-content h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.tim-policy-card-h-company {
    color: var(--tim-text-light);
    font-size: 13px;
    margin: 0 0 6px 0;
}

.tim-policy-card-h-coverage-amount {
    font-size: 13px;
    color: var(--tim-primary);
    font-weight: 600;
    margin: 0 0 6px 0;
}

.tim-policy-card-h-meta {
    font-size: 13px;
    color: var(--tim-text-light);
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.tim-policy-card-h-age-range {
    font-size: 12px;
    color: var(--tim-primary);
    font-weight: 600;
    margin: 0 0 6px 0;
}

.tim-policy-card-h-desc {
    font-size: 13px;
    color: #50575e;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

/* Company + description in one line (Step 2 select mode) */
.tim-policy-cards-select .tim-policy-card-h-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tim-policy-card-h-rate {
    margin: 0;
    font-size: 15px;
}

.tim-policy-card-h-rate strong {
    color: var(--tim-primary);
    font-size: 18px;
}

.tim-policy-card-h-days {
    font-size: 12px;
    color: var(--tim-text-light);
}

.tim-policy-card-h-coverage {
    flex: 0 0 auto;
    min-width: 140px;
}

.tim-policy-card-h-nocoverage {
    color: var(--tim-text-light);
    font-size: 13px;
}

.tim-policy-card-h-action {
    flex: 0 0 auto;
}

/* Step 3: Policy cards per passenger (radio selection) - layout: [image][policy info][rates/duration] */
.tim-policy-cards-passenger .tim-policy-card-h {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
}
.tim-policy-cards-passenger .tim-policy-card-h .tim-policy-card-h-col.tim-policy-card-h-image {
    flex: 0 0 100px;
}
.tim-policy-cards-passenger .tim-policy-card-h .tim-policy-card-h-col.tim-policy-card-h-content {
    flex: 1 1 auto;
    min-width: 0;
}
.tim-policy-cards-passenger .tim-policy-card-h .tim-policy-card-h-col.tim-policy-card-h-rate {
    flex: 0 0 auto;
}
.tim-policy-card-passenger {
    cursor: pointer;
}

.tim-policy-card-passenger.tim-policy-card-h-selected {
    border-color: var(--tim-primary);
    box-shadow: 0 2px 12px rgba(59, 117, 74, 0.2);
}

.tim-policy-card-passenger.tim-policy-card-ineligible {
    opacity: 0.5;
    filter: grayscale(80%);
    cursor: not-allowed;
    pointer-events: none;
}

.tim-policy-card-passenger.tim-policy-card-ineligible input[type="radio"] {
    pointer-events: none;
}

.tim-policy-cards-passenger .tim-policy-bracket-group {
    margin-bottom: 20px;
}

/* Step 3: Bracket header aligned with Date of Birth label style */
.tim-policy-cards-passenger .tim-policy-bracket-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tim-text);
    margin: 0 0 10px 0;
    padding: 0;
    line-height: 1.4;
}

.tim-policy-bracket-title-small {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: var(--tim-text-light);
}

.tim-policy-card-h-content h5 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.tim-button-outline {
    background: transparent;
    border: 2px solid var(--tim-primary);
    color: var(--tim-primary);
}

.tim-button-outline:hover {
    background: rgba(59, 117, 74, 0.08);
}

/* Legacy Policies Grid (if still used) */
.tim-policies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.tim-policy-card {
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
}

.tim-policy-card:hover {
    box-shadow: 0 4px 16px rgba(59, 117, 74, 0.15);
    border-color: var(--tim-primary-light);
    transform: translateY(-2px);
}

.tim-policy-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.tim-policy-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tim-policy-content {
    padding: 15px;
}

.tim-policy-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.tim-policy-company {
    color: #646970;
    font-size: 14px;
    margin: 0 0 10px 0;
}

.tim-policy-description {
    color: #50575e;
    font-size: 14px;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.tim-policy-rate {
    margin: 15px 0 0 0;
    font-size: 18px;
}

.tim-policy-rate strong {
    color: var(--tim-primary);
    font-size: 26px;
    font-weight: 700;
}

.tim-policy-rate span {
    color: var(--tim-text-light);
    font-size: 14px;
}

/* Passenger Blocks */
.tim-passenger-block {
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    background: var(--tim-bg-light);
    transition: all 0.3s ease;
}

.tim-passenger-block:hover {
    border-color: var(--tim-primary-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tim-passenger-block h4 {
    margin: 0 0 18px 0;
    color: var(--tim-primary);
    border-bottom: 3px solid var(--tim-primary);
    padding-bottom: 8px;
    font-size: 18px;
}

/* Step 3 cart – card + quantity (-) # (+) */
.tim-cart-item {
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--tim-bg-light);
}
.tim-cart-item-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.tim-cart-card {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 280px;
    min-width: 0;
}
.tim-cart-card-image {
    flex: 0 0 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--tim-border);
    border-radius: 6px;
    overflow: hidden;
}
.tim-cart-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.tim-cart-card-noimg {
    font-size: 11px;
    color: var(--tim-text-light);
    text-align: center;
    padding: 0 4px;
}
.tim-cart-card-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tim-cart-card-title { font-size: 16px; color: var(--tim-text); }
.tim-cart-card-company { font-size: 12px; color: var(--tim-text-light); }
.tim-cart-card-rate { font-size: 15px; color: var(--tim-primary); font-weight: 600; }
.tim-cart-card-per { font-size: 11px; font-weight: 400; color: var(--tim-text-light); }
.tim-cart-card-bracket { font-size: 12px; color: var(--tim-text-light); }
.tim-cart-qty-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.tim-cart-qty-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--tim-border);
    background: #fff;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--tim-text);
    transition: background .2s, border-color .2s;
}
.tim-cart-qty-btn:hover {
    background: var(--tim-primary);
    color: #fff;
    border-color: var(--tim-primary);
}
.tim-cart-qty-num {
    font-size: 24px;
    font-weight: 700;
    min-width: 36px;
    text-align: center;
    color: var(--tim-primary);
}
.tim-cart-item-passengers { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--tim-border); }

/* Step 3 – Invoice-style cost summary */
.tim-invoice-box {
    margin-top: 28px;
    padding: 24px;
    background: #fff;
    border: 2px solid var(--tim-primary);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(59, 117, 74, 0.08);
}
.tim-invoice-title {
    margin: 0 0 16px 0;
    color: var(--tim-primary);
    font-size: 18px;
    border-bottom: 2px solid var(--tim-primary);
    padding-bottom: 8px;
}
.tim-invoice-body { margin-bottom: 16px; }
.tim-invoice-promo {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--tim-border);
}
.tim-invoice-promo label { flex: 0 0 auto; font-weight: 600; }
.tim-invoice-promo .tim-input { flex: 1 1 180px; max-width: 240px; }
.tim-invoice-table { width: 100%; border-collapse: collapse; margin: 0; }
.tim-invoice-table thead th { padding: 8px 0; text-align: left; font-weight: 600; color: var(--tim-text); border-bottom: 1px solid var(--tim-border); }
.tim-invoice-table tfoot td { padding: 8px 0; vertical-align: top; }
.tim-invoice-table td { padding: 8px 0; vertical-align: top; }
.tim-invoice-amt { text-align: right; font-weight: 600; white-space: nowrap; }
.tim-invoice-sub { border-top: 1px solid var(--tim-border); }
.tim-invoice-disc { color: var(--tim-text-light); }
.tim-invoice-save { color: var(--tim-success); }

/* Step 4 social discount buttons */
.tim-step4-social-discount .tim-social-discount-btn {
    background: var(--tim-secondary);
    border-color: var(--tim-secondary);
    color: #fff;
}
.tim-step4-social-discount .tim-social-discount-btn:hover {
    background: var(--tim-primary);
    border-color: var(--tim-primary);
    color: #fff;
}
.tim-invoice-total { border-top: 2px solid var(--tim-primary); }
.tim-invoice-total td { padding-top: 12px; }

/* Step 4: Payment options layout – [Pay via QR][Pay via Bank] on one row, [Process payment later] full width */
.tim-step4-payment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1em 0;
}
.tim-step4-payment-row .tim-payment-option-card {
    flex: 1 1 260px;
    min-width: 0;
    padding: 1.25rem;
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    background: var(--tim-bg-light);
}
.tim-step4-pay-bank {
    background: #fff !important;
}
.tim-step4-payment-row .tim-payment-option-card h4 { margin: 0 0 8px 0; font-size: 1rem; }
.tim-step4-payment-row .tim-payment-option-card p { margin: 0 0 12px 0; font-size: 14px; color: var(--tim-text-light); }
.tim-proof-form { margin-top: 0; display: block; }
.tim-proof-upload-zone {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.25rem;
    margin: 10px 0 0 0;
    border: 2px dashed var(--tim-border);
    border-radius: 8px;
    background: var(--tim-bg-light);
    text-align: center;
}
.tim-proof-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}
.tim-proof-upload-zone .tim-proof-upload-btn { width: 100%; }
.tim-proof-filled {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.tim-proof-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--tim-border);
    flex-shrink: 0;
}
.tim-proof-filename {
    flex: 1 1 120px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--tim-text);
}
.tim-proof-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid var(--tim-border);
    border-radius: 50%;
    background: #fff;
    color: var(--tim-text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.tim-proof-remove:hover {
    background: var(--tim-error);
    border-color: var(--tim-error);
    color: #fff;
}
.tim-proof-msg { margin: 6px 0 0 0; }
.tim-proof-msg span { font-size: 13px; color: var(--tim-text-light); }
.tim-proof-msg span.tim-proof-err { color: var(--tim-error); }
.tim-proof-submit-wrap { margin: 12px 0 0 0; padding-top: 10px; border-top: 1px solid var(--tim-border); }
.tim-button-small { padding: 8px 14px; font-size: 13px; }
.tim-id-upload-group { margin-top: 10px; }
.tim-id-upload-zone { padding: 12px; border: 2px dashed var(--tim-border); border-radius: 10px; background: var(--tim-bg-light); }
.tim-id-upload-zone .tim-id-file-input { position: absolute; width: 0.1px; height: 0.1px; opacity: 0; z-index: -1; }
.tim-id-upload-zone .tim-id-empty { margin: 0; }

/* Step 2 passenger docs: gallery layout */
.tim-id-upload-zone .tim-id-list {
    display: none;
    margin-top: 12px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.tim-id-upload-zone .tim-id-item {
    position: relative;
    margin: 0;
}
.tim-id-upload-zone .tim-id-open {
    display: block;
    text-decoration: none;
    color: inherit;
}
.tim-id-upload-zone .tim-id-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--tim-border);
    background: #fff;
    display: block;
}
.tim-id-upload-zone .tim-id-thumb-file {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--tim-text);
    background: #fff;
}
.tim-id-upload-zone .tim-id-caption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--tim-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tim-id-upload-zone .tim-id-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.tim-id-upload-zone .tim-id-remove:hover { background: var(--tim-error); border-color: var(--tim-error); color: #fff; }
.tim-passenger-block.tim-passenger-block-error {
    border: 2px solid var(--tim-error);
    border-radius: 10px;
    padding: 12px;
    background: rgba(214, 54, 56, 0.04);
}

/* Step 2: policy preview card */
.tim-policy-preview { margin-top: 10px; }
.tim-policy-preview-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--tim-border);
    border-radius: 10px;
    background: #fff;
}
.tim-policy-preview-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--tim-border);
    background: #fff;
}
.tim-policy-preview-logo-empty { background: var(--tim-bg-light); }
.tim-policy-preview-title { font-weight: 700; color: var(--tim-text); }
.tim-policy-preview-company { font-size: 13px; color: var(--tim-text-light); margin-top: 2px; }
.tim-policy-preview-desc { font-size: 13px; color: var(--tim-text); margin-top: 8px; line-height: 1.5; }
.tim-policy-preview-details { display: inline-block; margin-top: 10px; font-weight: 600; }
.tim-policy-preview-rate { text-align: right; white-space: nowrap; color: var(--tim-text); }
.tim-policy-preview-rate span { font-size: 12px; color: var(--tim-text-light); margin-left: 4px; }
.tim-id-upload-zone .tim-id-filename { font-size: 13px; color: var(--tim-text); }
.tim-id-msg { font-size: 12px; color: var(--tim-text-light); display: block; margin-top: 4px; }
.tim-id-msg.tim-id-err { color: var(--tim-error); }
.tim-id-note { margin-top: 8px; margin-bottom: 16px; font-style: italic; }

/* Visual upload progress (Step 2 passenger docs) */
.tim-upload-progress { margin-top: 10px; display: none; }
.tim-upload-progress-label { font-size: 12px; color: var(--tim-text-light); margin-bottom: 6px; }
.tim-upload-progress-bar {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.08);
}
.tim-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--tim-primary), #1f8f4b);
    transition: width .15s linear;
}
.tim-step4-payment-later {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--tim-border);
    text-align: center;
}
.tim-step4-payment-later .tim-button-block { max-width: 360px; margin: 0 auto; }

/* Step 4 unified payment: chooser (radio) + panels */
.tim-payment-chooser {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    margin-bottom: 4px;
}
.tim-payment-chooser .tim-payment-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--tim-text);
}
.tim-payment-chooser .tim-payment-radio input[type="radio"] {
    accent-color: var(--tim-primary);
    cursor: pointer;
}
.tim-payment-chooser .tim-payment-radio:hover { color: var(--tim-primary); }
.tim-payment-chooser .tim-payment-radio input[type="radio"]:disabled { cursor: not-allowed; }
.tim-payment-panel {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--tim-border);
    border-radius: 8px;
    background: var(--tim-bg-light);
}
.tim-payment-panel p { margin: 0 0 12px 0; }
.tim-payment-panel p:last-child { margin-bottom: 0; }
.tim-step4-chooser-err { font-size: 14px; }

/* Payment Methods */
.tim-payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.tim-payment-method {
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tim-payment-method:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tim-payment-option {
    display: block;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.tim-payment-option input[type="radio"] {
    display: none;
}

.tim-payment-option input[type="radio"]:checked + .tim-payment-content {
    background: rgba(59, 117, 74, 0.05);
    border-color: var(--tim-primary);
    box-shadow: 0 0 0 3px rgba(59, 117, 74, 0.1);
}

.tim-payment-content {
    padding: 25px;
    background: #fff;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.tim-payment-content h3 {
    margin: 0 0 18px 0;
    color: var(--tim-primary);
    font-size: 20px;
    font-weight: 600;
}

.tim-qr-placeholder {
    padding: 40px;
    background: #f0f0f0;
    border: 2px dashed #8c8f94;
    border-radius: 4px;
    text-align: center;
    color: #646970;
}

.tim-bank-details {
    padding: 20px;
    background: var(--tim-bg-light);
    border-radius: 6px;
    border: 1px solid var(--tim-border);
}

.tim-bank-details p {
    margin: 12px 0;
    color: var(--tim-text);
    line-height: 1.6;
}

.tim-bank-details .tim-bank-additional {
    margin: 12px 0;
    color: var(--tim-text);
    line-height: 1.6;
}

.tim-payment-note {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 2px solid var(--tim-border);
    font-style: italic;
    color: var(--tim-text-light);
    font-size: 14px;
}

.tim-payment-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tim-payment-disabled .tim-payment-content {
    background: #f5f5f5;
}

.tim-coming-soon {
    color: var(--tim-warning);
    font-size: 14px;
    font-weight: 600;
    font-style: italic;
    background: rgba(255, 152, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 8px;
}

.tim-qr-code-image {
    text-align: center;
    margin: 15px 0;
}

.tim-qr-code-image img {
    display: block;
    margin: 0 auto;
    max-width: 350px;
    width: 100%;
    height: auto;
}

.tim-qr-note {
    margin-top: 10px;
    font-size: 14px;
    color: #646970;
    font-style: italic;
}

.tim-hitpay-embedded-qr .tim-hitpay-qr-intro,
.tim-hitpay-dropin .tim-hitpay-dropin-intro {
    margin-bottom: 16px;
    color: var(--tim-text);
}

.tim-hitpay-qr-img-wrap {
    text-align: center;
    margin: 20px 0;
}

.tim-hitpay-qr-img {
    max-width: 260px;
    height: auto;
    display: inline-block;
}

.tim-hitpay-status {
    margin: 16px 0;
    font-weight: 600;
    color: var(--tim-text);
}

.tim-hitpay-dropin-mount {
    min-height: 320px;
    margin: 16px 0;
}

/* Success Message */
.tim-success-message {
    text-align: center;
    padding: 40px 20px;
}

.tim-success-message h2 {
    color: var(--tim-success);
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 600;
}

.tim-success-message p {
    margin-bottom: 20px;
    font-size: 16px;
}

.tim-submission-failed {
    text-align: center;
    padding: 40px 20px;
}

.tim-submission-failed h2 {
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 600;
}

.tim-submission-failed p {
    margin-bottom: 20px;
    font-size: 16px;
}

.tim-qr-wait {
    margin-top: 8px;
    font-size: 13px;
    color: var(--tim-text-light, #646970);
}

/* Notices */
.tim-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid;
    border-radius: 4px;
}

.tim-notice-error {
    background: rgba(229, 57, 53, 0.1);
    border-color: var(--tim-error);
    color: #c62828;
}

/* Responsive */
@media (max-width: 768px) {
    .tim-form-container {
        padding: 20px 15px;
        margin: 15px;
        max-width: 100%;
    }
    
    .tim-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tim-policies-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tim-policy-card {
        margin-bottom: 20px;
    }
    
    .tim-policy-image img {
        max-width: 100%;
        height: auto;
    }
    
    .tim-policy-card-h {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tim-policy-card-h-image {
        flex: 0 0 auto;
        min-height: 70px;
    }
    
    .tim-policy-card-h-content {
        flex: 1 1 auto;
    }
    
    .tim-policy-card-h-coverage,
    .tim-policy-card-h-action {
        flex: 1 1 auto;
    }
    
    .tim-payment-methods {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tim-payment-method {
        margin-bottom: 15px;
    }
    
    .tim-step4-payment-row .tim-payment-option-card {
        flex: 1 1 100%;
    }
    
    .tim-step4-payment-later .tim-button-block {
        max-width: 100%;
    }
    
    .tim-step-indicator {
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px 0;
    }
    
    .tim-step {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .tim-step-indicator::before {
        display: none; /* Hide connecting line on mobile */
    }
    
    .tim-form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .tim-button {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }
    
    .tim-input, .tim-input select, .tim-input textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .tim-passenger-block {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .tim-passenger-block h4 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .tim-cart-item-row { flex-direction: column; align-items: flex-start; }
    .tim-cart-qty-wrap { align-self: flex-end; }
    .tim-invoice-promo .tim-input { max-width: 100%; }
    
    /* Breakdown table responsive */
    .tim-breakdown-table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tim-breakdown-table thead,
    .tim-breakdown-table tbody,
    .tim-breakdown-table tr {
        display: block;
    }
    
    .tim-breakdown-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .tim-breakdown-table tbody tr {
        border: 2px solid var(--tim-border);
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 10px;
        background: #fff;
    }
    
    .tim-breakdown-table td {
        display: block;
        border: none;
        position: relative;
        padding: 8px 10px 8px 40%;
        text-align: right;
    }
    
    .tim-breakdown-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 35%;
        text-align: left;
        font-weight: 600;
        color: var(--tim-primary);
    }
    
    .tim-policy-summary {
        padding: 15px;
    }
    
    .tim-policy-summary h3,
    .tim-computation-breakdown h3 {
        font-size: 18px;
    }
    
    .tim-policy-summary p {
        font-size: 14px;
        margin: 8px 0;
    }
    
    .tim-bank-details p,
    .tim-bank-details .tim-bank-additional {
        font-size: 14px;
        margin: 8px 0;
    }
    
    .tim-qr-code-image {
        text-align: center;
    }
    
    .tim-qr-code-image img {
        max-width: min(350px, 100%) !important;
        width: 100% !important;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .tim-form-container {
        padding: 15px 10px;
        margin: 10px;
    }
    
    .tim-step {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .tim-breakdown-table td {
        padding-left: 35%;
        font-size: 13px;
    }
    
    .tim-breakdown-table td:before {
        font-size: 12px;
    }
}

/* Computation Breakdown Styles */
.tim-policy-summary {
    background: var(--tim-bg-light);
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 35px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tim-policy-summary h3 {
    margin: 0 0 18px 0;
    color: var(--tim-primary);
    border-bottom: 3px solid var(--tim-primary);
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
}

.tim-policy-summary p {
    margin: 10px 0;
}

.tim-computation-breakdown {
    margin-bottom: 30px;
}

.tim-computation-breakdown h3 {
    margin: 0 0 18px 0;
    color: var(--tim-primary);
    border-bottom: 3px solid var(--tim-primary);
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
}

.tim-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border: 2px solid var(--tim-border);
    border-radius: 8px;
    overflow: hidden;
}

.tim-breakdown-table thead {
    background: var(--tim-primary);
}

.tim-breakdown-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--tim-primary-dark);
    color: #fff;
    font-size: 15px;
}

.tim-breakdown-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.tim-breakdown-table tbody tr:hover {
    background: #f9f9f9;
}

.tim-breakdown-table .tim-rate-amount {
    text-align: right;
    font-weight: 600;
    color: var(--tim-primary);
    font-size: 16px;
}

.tim-breakdown-table tfoot {
    background: var(--tim-bg-light);
    border-top: 3px solid var(--tim-primary);
}

.tim-breakdown-table .tim-total-row {
    font-size: 16px;
}

.tim-breakdown-table .tim-total-label {
    text-align: right;
    padding-right: 12px;
}

.tim-breakdown-table .tim-total-amount {
    text-align: right;
    font-size: 20px;
    color: var(--tim-primary);
    font-weight: 700;
}

/* Multi-country type-ahead */
.tim-multi-country { position: relative; }
.tim-multi-country .tim-country-search { width: 100%; margin-bottom: 8px; }
.tim-country-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 24px; }
.tim-country-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: var(--tim-bg-light); border: 1px solid var(--tim-border); border-radius: 4px; font-size: 13px; }
.tim-country-remove { background: none; border: none; cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; color: var(--tim-text-light); }
.tim-country-remove:hover { color: var(--tim-error); }
.tim-country-dropdown { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 50; max-height: 200px; overflow-y: auto; background: #fff; border: 1px solid var(--tim-border); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.tim-country-opt { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.tim-country-opt:hover { background: var(--tim-bg-hover); }

/* Step 3: Passenger block header - Passenger # and Remove on same line */
.tim-passenger-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tim-border);
}
.tim-passenger-head .tim-passenger-num {
    margin: 0;
    font-size: 16px;
}
.tim-passenger-remove {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #b91c1c !important;
}
.tim-passenger-remove:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
    color: #991b1b !important;
}
