/* =========================================================
   Lịch Tuốt Lá Mai – Front-end CSS
   Mobile First • Scoped class prefix: ltlm-
   ========================================================= */

.ltlm-wrapper {
    --ltlm-primary: #c9a227;
    --ltlm-primary-dark: #a6851a;
    --ltlm-bg: #fffdf7;
    --ltlm-card: #ffffff;
    --ltlm-border: #e8e0c8;
    --ltlm-text: #2c2c2c;
    --ltlm-muted: #6b6b6b;
    --ltlm-success: #2e7d32;
    --ltlm-warning: #e65100;
    --ltlm-radius: 14px;
    --ltlm-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ltlm-text);
    background: var(--ltlm-bg);
    border-radius: var(--ltlm-radius);
    padding: 20px 16px 28px;
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
    line-height: 1.5;
}

.ltlm-wrapper *,
.ltlm-wrapper *::before,
.ltlm-wrapper *::after {
    box-sizing: border-box;
}

/* ---------- HEADER ---------- */
.ltlm-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--ltlm-border);
}

.ltlm-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #8b6914;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.ltlm-subtitle {
    font-size: 0.95rem;
    color: var(--ltlm-muted);
    margin: 0;
}

/* ---------- SECTIONS ---------- */
.ltlm-section {
    margin-bottom: 26px;
}

.ltlm-section-title {
    font-size: 1.05rem;
    font-weight: 650;
    margin: 0 0 14px;
    color: #5c4a12;
}

/* ---------- YEAR GRID ---------- */
.ltlm-year-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ltlm-year-card {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 80px;
    cursor: pointer;
    position: relative;
}

.ltlm-year-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ltlm-year-num {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    background: var(--ltlm-card);
    border: 2px solid var(--ltlm-border);
    border-radius: 10px;
    font-weight: 650;
    font-size: 1.05rem;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ltlm-year-card.active .ltlm-year-num,
.ltlm-year-card:has(input:checked) .ltlm-year-num {
    border-color: var(--ltlm-primary);
    background: #fdf6e3;
    color: #8b6914;
}

/* ---------- OPTION CARDS (Bud + Weather) ---------- */
.ltlm-option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ltlm-option-card {
    cursor: pointer;
    position: relative;
    display: block;
}

.ltlm-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ltlm-card-inner {
    background: var(--ltlm-card);
    border: 2px solid var(--ltlm-border);
    border-radius: var(--ltlm-radius);
    padding: 16px 14px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ltlm-option-card.active .ltlm-card-inner,
.ltlm-option-card:has(input:checked) .ltlm-card-inner {
    border-color: var(--ltlm-primary);
    background: #fdf8eb;
    box-shadow: 0 0 0 1px var(--ltlm-primary);
}

.ltlm-card-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.ltlm-card-title {
    font-weight: 700;
    font-size: 0.98rem;
    color: #3d320a;
}

.ltlm-card-desc {
    font-size: 0.88rem;
    color: var(--ltlm-muted);
}

.ltlm-card-hint {
    font-size: 0.8rem;
    color: var(--ltlm-primary-dark);
    font-weight: 550;
    margin-top: 2px;
}

/* ---------- ACTION BUTTON ---------- */
.ltlm-action {
    margin: 28px 0 24px;
    text-align: center;
}

.ltlm-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    min-height: 54px;
    padding: 14px 24px;
    background: linear-gradient(180deg, #d4af37 0%, #b8941f 100%);
    color: #fff;
    font-size: 1.08rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(184, 148, 31, 0.35);
    transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.ltlm-btn-primary:hover,
.ltlm-btn-primary:focus {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(184, 148, 31, 0.45);
    outline: none;
}

.ltlm-btn-primary:active {
    transform: translateY(0);
}

.ltlm-btn-primary:disabled {
    opacity: 0.65;
    cursor: wait;
}

.ltlm-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    background: #fff;
    color: #8b6914;
    font-size: 0.98rem;
    font-weight: 650;
    border: 2px solid var(--ltlm-primary);
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.ltlm-btn-secondary:hover {
    background: #fdf6e3;
    color: #6b5010;
}

/* ---------- RESULT BOX ---------- */
.ltlm-result {
    background: #fff;
    border: 2px solid var(--ltlm-primary);
    border-radius: var(--ltlm-radius);
    padding: 22px 18px;
    margin-bottom: 28px;
    box-shadow: var(--ltlm-shadow);
    animation: ltlmFadeIn 0.3s ease;
}

@keyframes ltlmFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ltlm-result-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #8b6914;
    margin: 0 0 16px;
    text-align: center;
}

.ltlm-result-meta {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.ltlm-result-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.ltlm-result-meta-row strong {
    color: #5c4a12;
    min-width: 120px;
}

.ltlm-result-highlight {
    background: #fdf6e3;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

.ltlm-result-highlight-label {
    font-size: 0.9rem;
    color: var(--ltlm-muted);
    margin-bottom: 6px;
}

.ltlm-result-dates {
    font-size: 1.25rem;
    font-weight: 700;
    color: #8b6914;
    margin: 0 0 4px;
}

.ltlm-result-chap {
    font-size: 0.92rem;
    color: var(--ltlm-muted);
}

.ltlm-result-lunar {
    font-size: 1.02rem;
    font-weight: 650;
    color: #6b5010;
    margin: 6px 0 2px;
}

.ltlm-badge {
    display: inline-block;
    background: #e8f5e9;
    color: var(--ltlm-success);
    font-size: 0.82rem;
    font-weight: 650;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.ltlm-explanation {
    font-size: 0.92rem;
    color: #444;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    line-height: 1.55;
}

.ltlm-rain-warning {
    background: #fff3e0;
    border-left: 4px solid var(--ltlm-warning);
    padding: 12px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: #bf360c;
    margin-bottom: 14px;
}

.ltlm-disclaimer {
    font-size: 0.85rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px 14px;
    line-height: 1.5;
}

.ltlm-disclaimer strong {
    color: #c62828;
}

/* ---------- AFTER STEPS ---------- */
.ltlm-after-section {
    border-top: 2px solid var(--ltlm-border);
    padding-top: 22px;
}

.ltlm-steps {
    display: grid;
    gap: 14px;
    margin-bottom: 20px;
}

.ltlm-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--ltlm-card);
    border: 1px solid var(--ltlm-border);
    border-radius: 10px;
    padding: 14px;
}

.ltlm-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--ltlm-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ltlm-step strong {
    display: block;
    margin-bottom: 2px;
    color: #3d320a;
}

.ltlm-step p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ltlm-muted);
}

.ltlm-guide-link {
    text-align: center;
    margin-top: 8px;
}

/* ---------- TABLET+ ---------- */
@media (min-width: 540px) {
    .ltlm-wrapper {
        padding: 28px 24px 36px;
    }

    .ltlm-title {
        font-size: 1.65rem;
    }

    .ltlm-option-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 700px) {
    .ltlm-wrapper {
        padding: 32px 28px 40px;
    }

    .ltlm-weather-grid {
        grid-template-columns: 1fr 1fr;
    }
}

