/**
 * Justify.pk — Legal Draft Generator Styles
 * assets/css/legal-draft.css
 * Matches the existing Justify.pk design system
 */

/* ── Variables (mirrors style.css) ─────────────────────── */
:root {
    --ld-green:      #006600;
    --ld-green-mid:  #00A651;
    --ld-green-bg:   #e8f5ec;
    --ld-gold:       #D4AF37;
    --ld-gold-bg:    #fdf6dc;
    --ld-white:      #ffffff;
    --ld-gray:       #F5F5F5;
    --ld-border:     #e0e0e0;
    --ld-text:       #1A1A1A;
    --ld-muted:      #666666;
    --ld-danger:     #c0392b;
    --ld-danger-bg:  #fdf0ef;
    --ld-r:          8px;
    --ld-rl:         12px;
}

/* ── Hero ────────────────────────────────────────────────── */
.ld-hero {
    background: #003300;
    padding: 72px 0 56px;
    text-align: center;
    color: #fff;
}
.ld-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    padding: 5px 18px;
    border-radius: 100px;
    font-size: 13px;
    margin-bottom: 18px;
}
.ld-hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.2;
}
.ld-gold { color: var(--ld-gold); }
.ld-hero-sub {
    font-size: clamp(.95rem, 2vw, 1.1rem);
    color: rgba(255,255,255,.82);
    max-width: 680px;
    margin: 0 auto 32px;
    line-height: 1.7;
}
.ld-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}
.ld-hstat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ld-hstat strong { font-size: 1.4rem; font-weight: 700; color: var(--ld-gold); }
.ld-hstat span   { font-size: .75rem; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .5px; }
.ld-hsep { width: 1px; height: 36px; background: rgba(255,255,255,.18); }

/* ── Disclaimer bar ──────────────────────────────────────── */
.ld-disc-bar { background: var(--ld-gold-bg); border-bottom: 2px solid var(--ld-gold); padding: 12px 0; }
.ld-disc-bar-inner { display: flex; align-items: flex-start; gap: 10px; }
.ld-disc-bar-inner i { color: #8a6c00; font-size: 17px; flex-shrink: 0; margin-top: 2px; }
.ld-disc-bar-inner p { font-size: 12.5px; color: #5a4500; line-height: 1.55; margin: 0; }

/* ── Generator section ───────────────────────────────────── */
.ld-generator { padding: 52px 0; background: var(--ld-gray); }
.ld-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 1024px) { .ld-layout { grid-template-columns: 1fr; } }

/* ── Form panel ──────────────────────────────────────────── */
.ld-form-panel {
    background: var(--ld-white);
    border-radius: var(--ld-rl);
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    overflow: hidden;
}
.ld-form-header {
    background: var(--ld-green);
    padding: 20px 24px;
    color: #fff;
}
.ld-form-header h2 { font-size: 1.2rem; color: #fff; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.ld-form-header p  { font-size: 12.5px; color: rgba(255,255,255,.78); margin: 0; }

#legalDraftForm { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

/* ── Fields ──────────────────────────────────────────────── */
.ld-field { display: flex; flex-direction: column; gap: 5px; }
.ld-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .ld-field-row { grid-template-columns: 1fr; } }

.ld-field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ld-text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ld-field label i  { color: var(--ld-green-mid); font-size: 14px; }
.ld-field label em { font-weight: 400; color: var(--ld-muted); }
.ld-field label small { font-size: 11px; font-weight: 400; color: var(--ld-muted); width: 100%; }
.ld-req { color: var(--ld-danger); }

.ld-field input,
.ld-field select,
.ld-field textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--ld-border);
    border-radius: var(--ld-r);
    font-size: 13px;
    font-family: inherit;
    color: var(--ld-text);
    background: var(--ld-white);
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
}
.ld-field input:focus,
.ld-field select:focus,
.ld-field textarea:focus {
    outline: none;
    border-color: var(--ld-green-mid);
    box-shadow: 0 0 0 3px rgba(0,166,81,.1);
}
.ld-field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.ld-field-err input,
.ld-field-err select,
.ld-field-err textarea { border-color: var(--ld-danger); }

.ld-err { font-size: 11px; color: var(--ld-danger); font-weight: 600; min-height: 14px; }
.ld-char-row { font-size: 11px; color: var(--ld-muted); text-align: right; }
.ld-char-warn { color: var(--ld-danger) !important; font-weight: 600; }

/* ── Form actions ────────────────────────────────────────── */
.ld-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--ld-border);
}
.ld-form-actions .btn-primary { flex: 1; min-width: 180px; }

/* ── Output panel ────────────────────────────────────────── */
.ld-output-panel {
    background: var(--ld-white);
    border-radius: var(--ld-rl);
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    min-height: 460px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 90px;
}

/* Empty state */
.ld-out-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px 28px;
    flex: 1;
    min-height: 460px;
    gap: 12px;
}
.ld-out-icon {
    width: 68px; height: 68px;
    background: var(--ld-green-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.ld-out-icon i { font-size: 30px; color: var(--ld-green-mid); }
.ld-out-empty h3 { font-size: 1.15rem; color: var(--ld-text); margin: 0; }
.ld-out-empty p  { font-size: 13px; color: var(--ld-muted); max-width: 300px; line-height: 1.6; margin: 0; }
.ld-doc-tags { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; max-width: 320px; }
.ld-doc-tags span {
    background: var(--ld-green-bg);
    color: #004400;
    padding: 3px 11px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid rgba(0,102,0,.15);
}

/* Loading state */
.ld-out-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px 28px;
    min-height: 460px;
    gap: 12px;
}
.ld-spinner {
    width: 50px; height: 50px;
    border: 4px solid var(--ld-green-bg);
    border-top-color: var(--ld-green-mid);
    border-radius: 50%;
    animation: ldSpin .75s linear infinite;
}
@keyframes ldSpin { to { transform: rotate(360deg); } }
.ld-out-loading h3 { font-size: 1rem; color: var(--ld-text); margin: 0; }
.ld-out-loading p  { font-size: 12.5px; color: var(--ld-muted); margin: 0; }
.ld-load-steps { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 280px; }
.ld-lstep {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: #bbb;
    padding: 7px 12px; border-radius: var(--ld-r);
    transition: all .35s;
}
.ld-lstep i { font-size: 15px; color: #ddd; }
.ld-lstep.active { color: var(--ld-green); background: var(--ld-green-bg); font-weight: 600; }
.ld-lstep.active i { color: var(--ld-green-mid); }
.ld-lstep.done { color: var(--ld-muted); }
.ld-lstep.done i { color: var(--ld-green-mid); }

/* Result state */
.ld-out-result { display: flex; flex-direction: column; }
.ld-res-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ld-border);
    background: var(--ld-green-bg);
    border-radius: var(--ld-rl) var(--ld-rl) 0 0;
    flex-wrap: wrap;
    gap: 10px;
}
.ld-res-meta   { display: flex; align-items: center; gap: 10px; }
.ld-res-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.ld-badge-ok {
    display: inline-flex; align-items: center; gap: 5px;
    background: #d4edda; color: #155724;
    border: 1px solid #b8ddc2;
    padding: 3px 10px; border-radius: 100px; font-size: 11.5px; font-weight: 600;
}
.ld-res-label { font-size: 12.5px; font-weight: 600; color: #004400; }

.ld-draft-preview {
    padding: 20px 24px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.85;
    color: var(--ld-text);
    max-height: 480px;
    overflow-y: auto;
    background: #fafafa;
    border-left: 4px solid var(--ld-green);
    flex: 1;
}
.ld-draft-preview p { margin: 0 0 10px; }
.ld-draft-preview::-webkit-scrollbar       { width: 5px; }
.ld-draft-preview::-webkit-scrollbar-track { background: #f0f0f0; }
.ld-draft-preview::-webkit-scrollbar-thumb { background: var(--ld-green-mid); border-radius: 3px; }

.ld-res-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--ld-border);
    border-radius: 0 0 var(--ld-rl) var(--ld-rl);
}
.ld-consult-cta {
    display: flex; align-items: center; gap: 14px;
    background: var(--ld-gold-bg);
    border: 1px solid #e8d06a;
    border-radius: var(--ld-r);
    padding: 12px 14px;
    flex-wrap: wrap;
}
.ld-consult-cta i { font-size: 24px; color: #8a6c00; flex-shrink: 0; }
.ld-consult-cta > div { flex: 1; min-width: 140px; }
.ld-consult-cta strong { display: block; font-size: 12.5px; color: #5a4000; margin-bottom: 2px; }
.ld-consult-cta p { font-size: 11.5px; color: #7a6000; margin: 0; }

/* Error state */
.ld-out-error {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center;
    padding: 44px 28px; min-height: 460px; gap: 12px;
}
.ld-out-error i { font-size: 44px; color: var(--ld-danger); }
.ld-out-error h3 { font-size: 1.1rem; margin: 0; }
.ld-out-error p  { font-size: 13px; color: var(--ld-muted); max-width: 300px; margin: 0; }

/* ── How It Works ────────────────────────────────────────── */
.ld-how { padding: 64px 0; background: var(--ld-white); text-align: center; }
.ld-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ld-green-mid); margin-bottom: 10px; }
.ld-how h2 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 44px; }
.ld-steps-row {
    display: flex; align-items: flex-start;
    justify-content: center; flex-wrap: wrap;
    max-width: 800px; margin: 0 auto;
}
.ld-step { flex: 1; min-width: 200px; max-width: 240px; padding: 20px 16px; text-align: center; }
.ld-step-num { font-size: 2.8rem; font-weight: 800; color: var(--ld-green-bg); line-height: 1; font-family: 'Playfair Display', Georgia, serif; }
.ld-step i { font-size: 34px; color: var(--ld-green-mid); display: block; margin: -6px 0 14px; }
.ld-step h3 { font-size: .95rem; font-weight: 700; margin: 0 0 8px; }
.ld-step p  { font-size: 12.5px; color: var(--ld-muted); line-height: 1.6; margin: 0; }
.ld-step-conn { width: 40px; height: 2px; align-self: center; margin-top: -10px; flex-shrink: 0;
    background: repeating-linear-gradient(to right, var(--ld-green-mid) 0, var(--ld-green-mid) 6px, transparent 6px, transparent 12px); }
@media (max-width: 680px) { .ld-step-conn { display: none; } }

/* ── FAQ ─────────────────────────────────────────────────── */
.ld-faq { padding: 52px 0; background: var(--ld-gray); }
.ld-faq h2 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 28px; text-align: center; }
.ld-faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.ld-faq-item { background: var(--ld-white); border-radius: var(--ld-r); padding: 18px 20px; border-left: 4px solid var(--ld-green); }
.ld-faq-item h4 { font-size: 13px; font-weight: 700; color: var(--ld-green); margin: 0 0 7px; display: flex; align-items: center; gap: 7px; }
.ld-faq-item p  { font-size: 12.5px; color: var(--ld-muted); line-height: 1.6; margin: 0; }

/* ── Full Disclaimer ─────────────────────────────────────── */
.ld-full-disc { padding: 52px 0; background: #111; }
.ld-disc-box { border: 1px solid rgba(212,175,55,.3); border-radius: var(--ld-rl); padding: 36px; }
.ld-disc-box h3 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.2rem; color: var(--ld-gold); margin: 0 0 20px; display: flex; align-items: center; gap: 10px; }
.ld-disc-box p { font-size: 12.5px; color: rgba(255,255,255,.68); line-height: 1.8; margin: 0 0 14px; }
.ld-disc-box strong { color: rgba(255,255,255,.92); }
.ld-disc-contact { border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; margin-top: 6px; color: rgba(255,255,255,.55) !important; }
.ld-disc-contact a { color: var(--ld-gold); text-decoration: none; }
.ld-disc-contact a:hover { text-decoration: underline; }

/* ── Button overrides (btn-ghost for this page) ──────────── */
.ld-form-actions .btn-ghost,
.ld-res-actions  .btn-ghost {
    background: transparent;
    color: var(--ld-muted);
    border: 1.5px solid var(--ld-border);
}
.ld-form-actions .btn-ghost:hover,
.ld-res-actions  .btn-ghost:hover { background: var(--ld-gray); color: var(--ld-text); }

/* ── PDF button ──────────────────────────────────────────── */
.btn-danger {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
    font-weight: 600;
}
.btn-danger:hover:not(:disabled) {
    background: #a93226;
    border-color: #a93226;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(192,57,43,.3);
}
.btn-danger:disabled {
    opacity: .65;
    cursor: not-allowed;
}
