/* ============================================
   AstroTalk-inspired Report Layout
   ============================================ */

:root {
    --km-primary:   #b5451b;
    --km-secondary: #7c2d12;
    --km-gold:      #d4a017;
    --km-yellow:    #f5c518;
    --km-yellow-bg: #fffde7;
    --km-yellow-border: #f0d060;
    --km-bg:        #f9f7f2;
    --km-card:      #ffffff;
    --km-border:    #e8dcc8;
    --km-text:      #1c1917;
    --km-muted:     #78716c;
    --km-success:   #16a34a;
    --km-danger:    #dc2626;
    --km-info:      #2563eb;
    --km-radius:    12px;
    --km-shadow:    0 4px 32px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }

.km-wrapper {
    font-family: var(--al-global-family);
    max-width: 980px;
    margin: 0 auto;
    background: var(--km-bg);
    border-radius: var(--km-radius);
    box-shadow: var(--km-shadow);
    border: 1px solid var(--km-border);
    color: var(--km-text);
}
.km-person-card .km-field input {
    font-family: var(--al-global-family);
}
/* ── Header ── */
.km-header {
    background: linear-gradient(135deg, var(--km-primary) 0%, var(--km-secondary) 100%);
    color: white;
    text-align: center;
    padding: 36px 24px 28px;
    position: relative;
    overflow: hidden;
}
.km-header::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.km-header-icon { font-size: 46px; display: block; margin-bottom: 8px; position: relative; }
.km-title { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.5px; position: relative; }
.km-subtitle { margin: 0; opacity: .8; font-size: 13px; position: relative; }

/* ── Tabs ── */
.km-tabs {
    display: flex;
    border-bottom: 2px solid var(--km-border);
    background: #fff;
}
.km-tab {
    flex: 1; padding: 14px; background: none; border: none; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--km-muted);
    transition: all .2s; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.km-tab.active, .km-tab:hover { color: var(--km-primary); border-bottom-color: var(--km-primary); background: #fef7f0; }

/* ── Tab Content ── */
.km-tab-content { display: none; padding: 28px; background: #fff; }
.km-tab-content.active { display: block !important; }

/* ── Form ── */
.km-form-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}
@media (max-width: 640px) {
    .km-form-row { grid-template-columns: 1fr; }
    .km-hearts-divider { display: none; }
}
.km-hearts-divider {
    display: flex; align-items: center; justify-content: center; padding-top: 60px;
}
.km-hearts-divider span {
    background: #fce7f3; border-radius: 50%; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    border: 2px solid #fbcfe8;
}
.km-person-card {
    border-radius: var(--km-radius);
    border: 1.5px solid var(--km-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    font-family: var(--al-global-family);
}
.km-person-card{overflow: unset;}
.km-person-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; font-weight: 700; font-size: 14px; color: white;
}
.km-boy-head  { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.km-girl-head { background: linear-gradient(90deg, #be185d, #ec4899); }
.km-person-icon { font-size: 18px; }
.km-person-card .km-field { padding: 0 16px; margin-bottom: 14px; }
.km-person-card .km-field:first-of-type { margin-top: 14px; }

.km-field label {
    display: block; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; color: var(--km-muted); margin-bottom: 5px;
}
.km-field input, .km-field select {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--km-border); border-radius: 8px;
    font-size: 14px; color: var(--km-text); background: #fff; transition: border-color .2s;
}
.km-field input:focus, .km-field select:focus {
    outline: none; border-color: var(--km-primary);
    box-shadow: 0 0 0 3px rgba(181,69,27,.1);
}
.km-req { color: var(--km-danger); }

/* ── Button ── */
.km-btn {
    display: block; width: 100%; padding: 13px 24px;
    background: linear-gradient(135deg, var(--km-primary), var(--km-secondary));
    color: white; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.km-btn:hover { opacity: .9; transform: translateY(-1px); }
.km-btn-outline {
    background: white; color: var(--km-primary); border: 2px solid var(--km-primary);
    width: auto; padding: 10px 28px; display: inline-block;
}

/* ── Loading ── */
.km-loading { text-align: center; padding: 60px 20px; color: var(--km-muted); }
.km-spinner {
    width: 46px; height: 46px; border: 4px solid var(--km-border);
    border-top-color: var(--km-primary); border-radius: 50%;
    animation: km-spin 1s linear infinite; margin: 0 auto 16px;
}
@keyframes km-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════
   RESULT / REPORT SECTION
   ══════════════════════════════════════════════════ */
.km-result { padding: 28px 24px; background: #fff; }

/* Report Title */
.km-report-title {
    text-align: center;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--km-border);
    margin-bottom: 24px;
}
.km-report-title h2 {
    font-size: 26px; font-weight: 800; color: var(--km-text); margin: 0 0 12px;
}
.km-report-names {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    font-size: 16px;
}
.km-report-names .km-rname-box {
    border: 1.5px solid var(--km-border); border-radius: 6px;
    padding: 6px 20px; font-weight: 600; color: var(--km-text);
}
.km-report-names .km-heart-icon { font-size: 22px; }

/* Basic Details Section */
.km-basic-details {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;
}
@media(max-width:600px){ .km-basic-details{ grid-template-columns:1fr; } }
.km-basic-card {
    border-radius: 10px; overflow: hidden; border: 1.5px solid var(--km-yellow-border);
}
.km-basic-card-head {
    background: var(--km-yellow); padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 14px;
}
.km-basic-card-head .km-gender-badge {
    background: rgba(0,0,0,.12); border-radius: 20px;
    padding: 2px 10px; font-size: 11px; font-weight: 700; color: #333;
}
.km-basic-card table {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.km-basic-card table td {
    padding: 8px 14px; border-bottom: 1px solid var(--km-yellow-border);
}
.km-basic-card table td:first-child { font-weight: 600; color: var(--km-muted); width: 48%; }
.km-basic-card table tr:last-child td { border-bottom: none; }

/* Score Banner */
.km-score-banner {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
    border: 1.5px solid #fbbf24;
    border-radius: var(--km-radius);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}
@media(max-width:580px){ .km-score-banner{ flex-direction:column; text-align:center; } }
.km-score-circle-wrap { position: relative; flex-shrink: 0; }
.km-score-circle-wrap svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.km-circle-bg  { fill: none; stroke: #e5e7eb; stroke-width: 9; }
.km-circle-fill {
    fill: none; stroke-width: 9; stroke-linecap: round;
    stroke-dasharray: 283; stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease, stroke .5s;
}
.km-score-overlay {
    position: absolute; inset: 0; display: flex;
    flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.km-score-num  { font-size: 24px; font-weight: 800; color: var(--km-text); }
.km-score-denom{ font-size: 13px; color: var(--km-muted); font-weight: 600; }
.km-banner-info { flex: 1; }
.km-banner-couple { font-size: 14px; color: var(--km-muted); margin-bottom: 4px; }
.km-banner-rating { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.km-banner-nakshatra { font-size: 13px; color: var(--km-text); margin-bottom: 10px; }
.km-banner-doshas { display: flex; flex-wrap: wrap; gap: 6px; }
.km-dosha-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.km-dosha-pill.ok   { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.km-dosha-pill.warn { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* ── Section Heading ── */
.km-section-heading {
    font-size: 18px; font-weight: 700; color: var(--km-text);
    margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 3px solid var(--km-yellow);
    display: inline-block;
}

/* ── Ashtakoot Table ── */
.km-table-section { margin-bottom: 28px; }
.km-table-wrap { overflow-x: auto; }
.km-ashtakoot-table {
    width: 100%; border-collapse: collapse; font-size: 13px; min-width: 680px;
}
.km-ashtakoot-table thead tr {
    background: var(--km-yellow-bg); border-bottom: 2px solid var(--km-yellow-border);
}
.km-ashtakoot-table th {
    padding: 11px 12px; text-align: left; font-weight: 700;
    color: var(--km-text); font-size: 12.5px; white-space: nowrap;
}
.km-ashtakoot-table th:first-child { color: var(--km-gold); }
.km-ashtakoot-table td {
    padding: 10px 12px; vertical-align: top;
    border-bottom: 1px solid #f0e8d8; font-size: 13px; line-height: 1.45;
}
.km-ashtakoot-table tbody tr:last-child td { border-bottom: none; }
.km-ashtakoot-table tbody tr:hover { background: #fffbf2; }
.km-attr-name { font-weight: 700; font-size: 14px; }
/* colored attribute name - alternating colors like reference */
.km-attr-varna   { color: #b45309; }
.km-attr-vashya  { color: #854d0e; }
.km-attr-tara    { color: #c2410c; }
.km-attr-yoni    { color: #b45309; }
.km-attr-maitri  { color: #854d0e; }
.km-attr-gan     { color: #c2410c; }
.km-attr-bhakut  { color: #b45309; }
.km-attr-nadi    { color: #854d0e; }

.km-score-received { font-weight: 800; font-size: 15px; }
.km-score-received.full    { color: var(--km-success); }
.km-score-received.partial { color: var(--km-gold); }
.km-score-received.zero    { color: var(--km-danger); }
.km-ashtakoot-table tfoot tr {
    background: var(--km-yellow-bg); font-weight: 700;
    border-top: 2px solid var(--km-yellow-border);
}
.km-ashtakoot-table tfoot td { padding: 11px 12px; font-size: 14px; }

/* Score Note */
.km-score-note {
    background: var(--km-yellow-bg); border: 1.5px solid var(--km-yellow-border);
    border-radius: 8px; padding: 12px 16px; margin-top: 14px;
    font-size: 13.5px; color: var(--km-text); line-height: 1.5;
}

/* ── Dosha Section ── */
.km-dosha-section-wrap { margin-bottom: 20px; }
.km-dosha-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px;
}
@media(max-width:500px){ .km-dosha-cards{ grid-template-columns:1fr; } }
.km-dosha-card {
    border-radius: 10px; border: 1.5px solid var(--km-yellow-border);
    padding: 16px 20px; text-align: center;
}
.km-dosha-card-title { font-size: 12px; color: var(--km-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.km-dosha-card-value { font-size: 18px; font-weight: 800; }
.km-dosha-card-value.ok   { color: var(--km-success); }
.km-dosha-card-value.warn { color: var(--km-danger); }
.km-dosha-note {
    background: #fffde7; border: 1.5px solid var(--km-yellow-border);
    border-radius: 8px; padding: 12px 16px;
    font-size: 13px; color: var(--km-text); line-height: 1.55;
}

/* ── Disclaimer ── */
.km-disclaimer {
    text-align: center; font-size: 12px; color: var(--km-muted);
    padding: 12px 24px 16px; background: #fff; margin: 0;
    border-top: 1px solid var(--km-border);
}

/* ══════════════════════════════════════════════════
   ASTROTALK-STYLE DATE PICKER  (DOB tab only)
   ══════════════════════════════════════════════════ */

/* Input trigger */
.km-datepicker-wrap,
.km-timepicker-wrap {
    position: relative;
}
.km-datepicker-input,
.km-timepicker-input {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--km-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--km-text);
    background: #fff;
    cursor: pointer;
    transition: border-color .2s;
    user-select: none;
}
.km-datepicker-input:focus,
.km-timepicker-input:focus,
.km-datepicker-input.km-dp-open,
.km-timepicker-input.km-tp-open {
    outline: none;
    border-color: var(--km-primary);
    box-shadow: 0 0 0 3px rgba(181,69,27,.1);
}
.km-datepicker-input.km-dp-filled .km-dp-text,
.km-timepicker-input.km-tp-filled .km-tp-text {
    color: var(--km-text);
    font-weight: 500;
}
.km-datepicker-input .km-dp-text,
.km-timepicker-input .km-tp-text {
    color: #aaa;
}

/* ── Dropdown shell ── */
.km-dp-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    width: 300px;
    overflow: hidden;
}

/* ── AstroTalk Calendar: Yellow header bar ── */
.km-dp-cal-header {
    background: #f5c518;
    padding: 12px 14px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.km-dp-cal-month-year {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.km-dp-cal-month-year .km-dp-arrow-down {
    font-size: 10px;
    color: #555;
}
.km-dp-cal-nav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #444;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background .15s;
    padding: 0;
    line-height: 1;
}
.km-dp-cal-nav:hover { background: rgba(0,0,0,.08); }
.km-dp-cal-nav:disabled { opacity: .3; cursor: default; }

/* Weekday row */
.km-dp-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px 10px 4px;
    background: #fff;
}
.km-dp-cal-wday {
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #888;
    padding: 2px 0;
}

/* Day grid */
.km-dp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0 10px 12px;
    gap: 1px;
}
.km-dp-cal-month-label {
    grid-column: 1 / -1;
    font-size: 10.5px;
    font-weight: 700;
    color: #aaa;
    padding: 2px 2px 4px;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.km-dp-cal-day {
    text-align: center;
    padding: 7px 2px;
    font-size: 13px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .12s, color .12s;
    color: #333;
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
}
.km-dp-cal-day:hover { background: #f0e8dc; }
.km-dp-cal-day.km-dp-selected {
    background: #f5c518;
    color: #222;
    font-weight: 700;
    border-radius: 50%;
}
.km-dp-cal-day.km-dp-today {
    border: 2px solid #f5c518;
    font-weight: 600;
}
.km-dp-cal-day.km-dp-empty {
    cursor: default;
    background: none !important;
}
.km-dp-cal-day.km-dp-disabled {
    opacity: .3;
    cursor: default;
}
.km-dp-cal-day.km-dp-disabled:hover { background: none; }

/* ── Year/Month picker overlay (shown when header clicked) ── */
.km-dp-ym-view {
    padding: 12px;
}
.km-dp-ym-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.km-dp-ym-header span {
    font-size: 15px;
    font-weight: 700;
    color: var(--km-text);
}
.km-dp-year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}
.km-dp-year-cell {
    padding: 8px 4px;
    text-align: center;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, color .15s;
    color: var(--km-text);
}
.km-dp-year-cell:hover { background: #fef9c3; }
.km-dp-year-cell.km-dp-selected {
    background: #f5c518;
    color: #222;
    font-weight: 700;
}
.km-dp-year-cell.km-dp-current-year {
    border: 1.5px solid #f5c518;
    font-weight: 600;
}
.km-dp-month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.km-dp-month-cell {
    padding: 8px 4px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, color .15s;
    color: var(--km-text);
}
.km-dp-month-cell:hover { background: #fef9c3; }
.km-dp-month-cell.km-dp-selected {
    background: #f5c518;
    color: #222;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════
   ASTROTALK-STYLE ANALOG CLOCK TIME PICKER
   ══════════════════════════════════════════════════ */

.km-tp-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    width: 280px;
    overflow: hidden;
}

/* Yellow time display header */
.km-tp-header {
    background: #f5c518;
    padding: 16px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.km-tp-hh,
.km-tp-mm {
    font-size: 40px;
    font-weight: 800;
    color: #333;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    padding: 0 4px;
    transition: background .15s;
}
.km-tp-hh:hover,
.km-tp-mm:hover { background: rgba(0,0,0,.08); }
.km-tp-hh.km-tp-active,
.km-tp-mm.km-tp-active { color: #111; }
.km-tp-sep {
    font-size: 38px;
    font-weight: 800;
    color: #333;
    line-height: 1;
    margin-bottom: 2px;
}
.km-tp-ampm-col {
    display: flex;
    flex-direction: column;
    margin-left: 4px;
    gap: 2px;
}
.km-tp-am,
.km-tp-pm {
    font-size: 14px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background .15s, color .15s;
    line-height: 1.3;
}
.km-tp-am.km-tp-ampm-active,
.km-tp-pm.km-tp-ampm-active {
    color: #111;
    font-weight: 900;
}

/* Clock face */
.km-tp-clock-wrap {
    padding: 14px 16px 10px;
    display: flex;
    justify-content: center;
}
.km-tp-clock {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #f5f5f5;
}
.km-tp-clock-number {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: background .12s, color .12s;
    z-index: 2;
}
.km-tp-clock-number:hover { background: #e0e0e0; }
.km-tp-clock-number.km-tp-num-selected {
    background: #f5c518;
    color: #222;
    font-weight: 800;
}

/* Clock hand */
.km-tp-clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    width: 2px;
    background: #f5c518;
    border-radius: 2px 2px 0 0;
    margin-left: -1px;
    z-index: 1;
    transition: transform .2s, height .2s;
}
.km-tp-clock-center {
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    background: #f5c518;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

/* Action buttons */
.km-tp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 14px 12px;
}
.km-tp-cancel,
.km-tp-ok {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: #555;
    padding: 6px 10px;
    border-radius: 5px;
    transition: background .12s, color .12s;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.km-tp-cancel:hover { background: #f0f0f0; color: #333; }
.km-tp-ok {
    color: #b5451b;
}
.km-tp-ok:hover { background: #fef3e8; color: #b5451b; }