/* India Post Free — Public Widget Styles */

.ipf-widget {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 700px;
}

.ipf-widget-title {
    margin: 0 0 18px 0;
    font-size: 18px;
    color: #1a1a2e;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Form layout */
.ipf-form { width: 100%; }
.ipf-row  { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.ipf-col  { flex: 1; min-width: 140px; display: flex; flex-direction: column; }

.ipf-form label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.ipf-form input[type="text"],
.ipf-form input[type="number"],
.ipf-form input[type="email"],
.ipf-form select,
.ipf-form textarea {
    border: 1px solid #ccd;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s;
}
.ipf-form input:focus,
.ipf-form select:focus,
.ipf-form textarea:focus {
    border-color: #0073aa;
    outline: none;
    background: #fff;
}

.ipf-help { font-size: 12px; color: #888; margin: -10px 0 10px 0; }

/* Buttons */
.ipf-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 22px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s;
}
.ipf-btn:hover { background: #005f8e; }
.ipf-btn:disabled { background: #aaa; cursor: not-allowed; }
.ipf-btn-book { background: #27ae60; width: 100%; padding: 12px; font-size: 16px; }
.ipf-btn-book:hover { background: #1e8449; }

/* Result area */
.ipf-result {
    margin-top: 20px;
    animation: ipf-fadein 0.3s ease;
}
@keyframes ipf-fadein { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.ipf-loader {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* Result table */
.ipf-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 10px;
}
.ipf-result-table th,
.ipf-result-table td {
    padding: 9px 12px;
    border: 1px solid #e8e8e8;
    text-align: left;
}
.ipf-result-table thead tr { background: #003366; color: #fff; }
.ipf-result-table tbody tr:nth-child(even) { background: #f9f9f9; }
.ipf-result-table .ipf-total { background: #e8f5e9; font-weight: 700; font-size: 15px; }

/* Tariff result */
.ipf-tariff-result h4 { margin: 0 0 10px; color: #003366; }

/* Tracking cards */
.ipf-track-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}
.ipf-track-header {
    background: #003366;
    color: #fff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}
.ipf-del-badge {
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 700;
}
.ipf-track-meta {
    padding: 8px 14px;
    background: #f5f7fa;
    font-size: 12px;
    color: #555;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e8e8e8;
}
.ipf-track-timeline { padding: 12px 14px; }
.ipf-track-event {
    display: grid;
    grid-template-columns: 130px 1fr 1fr auto;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 13px;
    align-items: center;
}
.ipf-track-event:last-child { border-bottom: none; }
.ipf-event-date   { color: #888; font-size: 12px; }
.ipf-event-name   { font-weight: 600; color: #222; }
.ipf-event-office { color: #555; }
.ipf-event-remark { color: #e67e22; font-style: italic; font-size: 12px; }

/* Pincode badge */
.ipf-badge {
    background: #003366;
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
}

/* Alerts */
.ipf-alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}
.ipf-alert-error   { background: #fdf0f0; border: 1px solid #e74c3c; color: #c0392b; }
.ipf-alert-success { background: #f0fdf4; border: 1px solid #27ae60; color: #1e8449; }

/* Quota bar */
.ipf-quota { margin-bottom: 16px; }
.ipf-quota-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}
.ipf-quota-fill {
    height: 100%;
    background: #0073aa;
    border-radius: 3px;
    transition: width 0.4s;
    min-width: 4px;
}
.ipf-quota-label { font-size: 12px; color: #666; margin: 4px 0 0 0; }

/* Booking success */
.ipf-booking-success {
    background: #f0fdf4;
    border: 1px solid #27ae60;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}
.ipf-booking-success h4 { margin: 0 0 8px; color: #1e8449; }
.ipf-booking-success table { font-size: 14px; }
.ipf-booking-success td { padding: 4px 10px; }

/* Section headings inside booking form */
.ipf-booking-widget h4 {
    margin: 18px 0 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #003366;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 6px;
}

/* Responsive */
@media (max-width: 600px) {
    .ipf-row { flex-direction: column; }
    .ipf-track-event { grid-template-columns: 1fr 1fr; }
}
