/*
   Yeşil Ege Peyzaj — Bitki Doktoru sayfası
   Teşhis ekranlı hero, fotoğraf yükleme alanı, belirti çipleri ve onay kutuları.
   Canlı ekran temel stilleri (.screen, .scr-head, .bar) screens.css'ten gelir.
*/

/* !important: .form-group input gibi genel form kurallarına ezilmesin */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================
   1. Hero — teşhis ekranı
   =========================== */
.doc-hero {
    position: relative;
    margin: 12px 12px 0;
    padding: calc(var(--nav-h) + clamp(2rem, 5vw, 4rem)) 0 clamp(3rem, 6vw, 5rem);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: var(--white);
    background:
        radial-gradient(ellipse 60% 60% at 85% 20%, rgba(111, 143, 114, 0.28), transparent 70%),
        var(--forest-900);
}

.doc-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.doc-hero h1 {
    color: var(--white);
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.doc-hero h1 em {
    font-style: italic;
    color: #e8d3ad;
}

.doc-hero p {
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1.02rem, 1.3vw, 1.15rem);
    max-width: 560px;
    margin-bottom: 2rem;
}

.doc-scan {
    position: relative;
    aspect-ratio: 4 / 5;
    max-height: 560px;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}

.doc-scan-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.doc-scan::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(rgba(143, 191, 127, 0.08) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, rgba(143, 191, 127, 0.08) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(180deg, transparent 40%, rgba(10, 22, 18, 0.7));
}

/* Yukarıdan aşağı tarayan ışık çizgisi */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: var(--scr-leaf);
    box-shadow: 0 0 18px 4px rgba(143, 191, 127, 0.55);
    animation: scan 3.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes scan {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, min(560px, 125vw), 0); }
}

/* Bulunan belirti işaretleri */
.scan-mark {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border: 2px solid var(--scr-sun);
    border-radius: 50%;
    animation: mark 3.6s ease-out infinite;
}

.scan-mark + .scan-mark {
    animation-delay: 0.8s;
}

@keyframes mark {
    0%, 30% { transform: scale(0.4); opacity: 0; }
    45% { transform: scale(1.1); opacity: 1; }
    60%, 85% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

.doc-screen {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
}

.doc-findings {
    list-style: none;
    display: grid;
    gap: 8px;
}

.doc-findings li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.doc-findings span {
    color: var(--scr-muted);
}

.doc-findings b {
    color: var(--scr-sun);
}

.doc-screen .bar i {
    --p: 72%;
}

/* ===========================
   2. Adımlar
   =========================== */
.doc-steps {
    grid-template-columns: repeat(3, 1fr);
}

/* ===========================
   3. Form bölümü
   =========================== */
.doc-form-section {
    background: var(--sand-100);
}

.doc-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.doc-tips h2 {
    margin-bottom: 1.5rem;
}

.doc-tip-list {
    list-style: none;
    display: grid;
    gap: 18px;
    margin-bottom: 2rem;
}

.doc-tip-list li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.doc-tip-list i {
    flex: none;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--forest-700);
    color: var(--sage-300);
}

.doc-tip-list strong {
    display: block;
    color: var(--forest-800);
}

.doc-tip-list span {
    font-size: 0.93rem;
    color: var(--ink-soft);
}

.doc-privacy {
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: var(--sage-100);
    font-size: 0.9rem;
    color: var(--forest-800);
}

.doc-privacy i {
    color: var(--forest-600);
    margin-right: 4px;
}

.doc-label,
.symptom-group legend {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--forest-800);
    margin-bottom: 8px;
}

.doc-label small,
.symptom-group small,
.doc-form label small {
    font-weight: 400;
    color: var(--ink-soft);
}

/* Sürükle-bırak alanı (.form-group label kuralını ezmek için form-group altında) */
.form-group .dropzone {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 28px 16px;
    border: 2px dashed var(--sage-300);
    border-radius: var(--radius);
    background: var(--cream);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.dropzone i {
    font-size: 1.6rem;
    color: var(--sage-500);
    margin-bottom: 6px;
}

.dropzone strong {
    color: var(--forest-800);
}

.dropzone span {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--sage-500);
    background: var(--sage-100);
}

/* Dosya girdisi gizli; klavye odağı sürükle-bırak alanında gösterilir */
.form-group:has(#pd-photos:focus-visible) .dropzone {
    outline: 3px solid rgba(111, 143, 114, 0.45);
    outline-offset: 2px;
}

.dropzone.is-full {
    display: none;
}

.photo-previews {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.photo-previews:empty {
    display: none;
}

.photo-previews li {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--sand-200);
    animation: swap 0.4s var(--ease);
}

.photo-previews img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-previews button {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(18, 38, 31, 0.8);
    color: var(--white);
    cursor: pointer;
}

.photo-previews .size {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    background: rgba(18, 38, 31, 0.75);
    color: var(--white);
}

/* Belirti çipleri */
.symptom-group {
    border: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.symptom-group legend {
    width: 100%;
}

.chip-check {
    position: relative;
    cursor: pointer;
}

.chip-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-check span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--cream);
    font-size: 0.88rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.chip-check input:checked + span {
    background: var(--forest-700);
    border-color: var(--forest-700);
    color: var(--white);
}

.chip-check input:focus-visible + span {
    outline: 3px solid rgba(111, 143, 114, 0.45);
    outline-offset: 2px;
}

/* Onay kutuları */
.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.consent input {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--forest-700);
}

.consent a {
    color: var(--forest-700);
    text-decoration: underline;
}

.doc-form .btn-submit {
    margin-top: 8px;
}

.doc-status {
    margin-top: 12px;
    font-size: 0.92rem;
    color: var(--forest-700);
}

.doc-status:empty {
    display: none;
}

.doc-status.is-error {
    color: var(--clay-700);
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea,
.form-group.has-error .dropzone {
    border-color: var(--clay-600);
}

/* Başarı durumu */
.doc-success {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: clamp(2rem, 5vw, 3.5rem);
    border-radius: var(--radius-lg);
    background: var(--white);
    border: 1px solid var(--line);
    text-align: center;
}

.doc-success[hidden] {
    display: none;
}

.doc-success > i {
    font-size: 3rem;
    color: var(--sage-500);
}

.doc-success h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
}

/* ===========================
   4. Mobil
   =========================== */
@media (max-width: 960px) {
    .doc-hero-grid,
    .doc-form-grid {
        grid-template-columns: 1fr;
    }

    .doc-scan {
        max-height: 460px;
    }

    .doc-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .doc-hero {
        margin: 8px 8px 0;
        border-radius: var(--radius);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scan-line,
    .scan-mark {
        animation: none;
    }

    .scan-mark {
        opacity: 1;
    }
}

/* ===========================
   5. Yasal metin sayfası (KVKK)
   =========================== */
.legal {
    padding-top: calc(var(--nav-h) + clamp(2rem, 5vw, 4rem));
}

.legal-body {
    max-width: 780px;
}

.legal-body h1 {
    margin-bottom: 0.5rem;
}

.legal-body h2 {
    font-size: 1.5rem;
    margin: 2.25rem 0 0.75rem;
}

.legal-body p,
.legal-body li {
    color: var(--ink-soft);
}

.legal-body ul {
    padding-left: 1.25rem;
    display: grid;
    gap: 6px;
}

.legal-body a {
    color: var(--forest-700);
    text-decoration: underline;
}

.legal-updated {
    font-size: 0.88rem;
    margin-bottom: 2rem;
}

.legal-draft {
    padding: 12px 16px;
    border: 1px solid var(--sand-200);
    border-radius: var(--radius-sm);
    background: var(--sand-100);
}
