/* ============================================================================
   testimonials.css  —  Mainland custom testimonial / review system
   Premium, clean, responsive real-estate style.
   Reuses your existing design tokens from css/style.css (--paper, --ink,
   --gold, etc.) and falls back gracefully if loaded on its own.
   All classes are namespaced with .ml- so nothing here can clash with or
   override your existing site styles.
============================================================================ */

.ml-form-wrap,
.ml-list-wrap {
    --ml-paper: var(--paper, #FCFBF9);
    --ml-ink:   var(--ink, #16150F);
    --ml-muted: var(--muted, #6E6A60);
    --ml-line:  var(--line, #E6E1D6);
    --ml-stone: var(--stone, #F1EDE3);
    --ml-gold:  var(--gold, #B8934A);
    --ml-gold-light: var(--gold-light, #F5EDD8);
    --ml-radius: 14px;
    --ml-ease: cubic-bezier(.19, 1, .22, 1);
    font-family: "DM Sans", sans-serif;
    color: var(--ml-ink);
}

/* ---------------------------------------------------------------- FORM ---- */
.ml-form-wrap { max-width: 640px; margin: 0 auto; }

.ml-form-card {
    background: var(--ml-paper);
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius);
    padding: clamp(24px, 4vw, 48px);
    box-shadow: 0 40px 80px -50px rgba(28, 24, 12, .35);
}

.ml-form-header { text-align: center; margin-bottom: 28px; }

.ml-kicker {
    font-size: .68rem; font-weight: 700; letter-spacing: .34em;
    text-transform: uppercase; color: var(--ml-muted);
}

.ml-form-title {
    font-family: "Bebas Neue", sans-serif; font-weight: 400;
    letter-spacing: .04em; line-height: .95;
    font-size: clamp(2.2rem, 5vw, 3rem); margin: 8px 0 10px;
}

.ml-form-sub { color: var(--ml-muted); font-size: .96rem; margin: 0 auto; max-width: 440px; }

.ml-field { margin-bottom: 20px; }

.ml-field > label {
    display: block; font-size: .82rem; font-weight: 600; letter-spacing: .02em;
    margin-bottom: 8px; color: var(--ml-ink);
}

.ml-req { color: var(--ml-gold); }
.ml-opt { color: var(--ml-muted); font-weight: 400; }

.ml-field input[type="text"],
.ml-field textarea,
.ml-field input[type="file"] {
    width: 100%; font-family: inherit; font-size: .98rem; color: var(--ml-ink);
    background: #fff; border: 1px solid var(--ml-line); border-radius: 8px;
    padding: 13px 15px; transition: border-color .3s var(--ml-ease), box-shadow .3s var(--ml-ease);
}
.ml-field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.ml-field input:focus,
.ml-field textarea:focus {
    outline: none; border-color: var(--ml-gold);
    box-shadow: 0 0 0 3px var(--ml-gold-light);
}

.ml-field input[type="file"] { padding: 10px 12px; cursor: pointer; }

.ml-hint { display: block; font-size: .76rem; color: var(--ml-muted); margin-top: 6px; }

/* Inline validation errors */
.ml-error {
    display: none; font-size: .78rem; color: #b4231f; margin-top: 6px; font-weight: 500;
}
.ml-error.show { display: block; }
.ml-field.ml-invalid input,
.ml-field.ml-invalid textarea { border-color: #b4231f; }

/* Star rating input */
.ml-rate { display: inline-flex; gap: 6px; }
.ml-rate-star {
    background: none; border: none; cursor: pointer; padding: 2px;
    font-size: 2rem; line-height: 1; color: var(--ml-line);
    transition: color .15s var(--ml-ease), transform .15s var(--ml-ease);
}
.ml-rate-star:hover { transform: scale(1.12); }
.ml-rate-star.on { color: #ffa500; }

/* Consent checkbox */
.ml-check {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: .9rem; font-weight: 400; color: var(--ml-ink); cursor: pointer;
}
.ml-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--ml-gold); flex: 0 0 auto; }

/* File preview */
.ml-preview { margin-top: 12px; }
.ml-preview img,
.ml-preview video {
    max-width: 100%; max-height: 220px; border-radius: 10px;
    border: 1px solid var(--ml-line); display: block;
}

/* Submit button — matches your .btn-pill aesthetic */
.ml-submit {
    width: 100%; margin-top: 6px; cursor: pointer;
    font-family: inherit; font-weight: 600; font-size: .95rem; letter-spacing: .02em;
    padding: 16px 28px; border: 1px solid var(--ml-ink); border-radius: 100px;
    background: var(--ml-ink); color: var(--ml-paper);
    transition: .45s var(--ml-ease);
}
.ml-submit:hover { background: transparent; color: var(--ml-ink); }
.ml-submit:disabled { opacity: .6; cursor: not-allowed; }

/* Success / error banner */
.ml-message { display: none; border-radius: 10px; padding: 14px 16px; margin-bottom: 22px; font-size: .92rem; font-weight: 500; }
.ml-message.show { display: block; }
.ml-message.ok  { background: #ecf6ec; color: #1f6b32; border: 1px solid #c7e6c9; }
.ml-message.err { background: #fbeceb; color: #9a2520; border: 1px solid #f0c9c6; }

/* Honeypot — visually hidden, off-screen, never shown to real users */
.ml-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Two-column file row inside the form (photo + video side by side) */
.ml-file-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .ml-file-row { grid-template-columns: 1fr; } }

/* ================================================================ SLIDER == */
.ml-slider {
    --ml-paper: var(--paper, #FCFBF9);
    --ml-ink:   var(--ink, #16150F);
    --ml-ink-2: var(--ink-2, #2A2820);
    --ml-muted: var(--muted, #6E6A60);
    --ml-line:  var(--line, #E6E1D6);
    --ml-gold:  var(--gold, #B8934A);
    --ml-gold-light: var(--gold-light, #F5EDD8);
    --ml-radius: 16px;
    --ml-ease: cubic-bezier(.19, 1, .22, 1);
    --ml-card-w: 360px;          /* base card width on desktop */
    position: relative;
    max-width: 1280px; margin: 0 auto;
    font-family: "DM Sans", sans-serif;
}

/* The horizontal scrolling track */
.ml-track {
    display: flex; gap: 26px;
    overflow-x: auto; 
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 10px 4px 28px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;                 /* Firefox */
}
.ml-track::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.ml-card {
    scroll-snap-align: start;
    flex: 0 0 var(--ml-card-w);
    max-width: var(--ml-card-w);
    background: #fff; border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius); overflow: hidden;
    display: flex; flex-direction: column;
    /* box-shadow: 0 30px 60px -50px rgba(28, 24, 12, .4); */
    transition: transform .5s var(--ml-ease), box-shadow .5s var(--ml-ease);
    padding: 15px;
}
.ml-card:hover { transform: translateY(-5px); }

/* Media area (photo or video with play overlay) */
.ml-card-media {
    position: relative; aspect-ratio: 16 / 20; background: #0d0d0d;
    overflow: hidden;
    border-radius: 16px;
}
.ml-card-media img,
.ml-card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Central play button — DoorLoop style */
.ml-play {
    position: absolute; inset: 0; margin: auto;
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(255, 255, 255, .92); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .5);
    transition: transform .3s var(--ml-ease), background .3s var(--ml-ease);
}
.ml-play svg { width: 26px; height: 26px; fill: var(--ml-ink); margin-left: 3px; }
.ml-play:hover { transform: scale(1.1); background: #fff; }
.ml-card-media.playing .ml-play { display: none; }

/* Card text body */
.ml-card-body { padding: 10px 0 0 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ml-quote {
    font-family: "Bebas Neue", sans-serif; color: var(--ml-gold);
    font-size: 3rem; line-height: .4; height: 22px; display: none;
}
.ml-card-body .ml-stars { font-size: 1.8rem; letter-spacing: 2px; }
.ml-star { color: var(--ml-line); }
.ml-star.on { color: #ffa500; }

.ml-review {
    font-size: 15px; line-height: 1.7; color: var(--ml-ink-2);
    margin: 0; flex: 1;
}

.ml-card-foot { display: flex; align-items: center; gap: 13px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--ml-line); }
.ml-avatar {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; overflow: hidden;
    background: var(--ml-gold-light); color: var(--ml-gold);
    display: flex; align-items: center; justify-content: center;
    font-family: "Bebas Neue", sans-serif; font-size: 1.35rem; letter-spacing: .04em;
}
/* Uploaded photo fills the avatar circle */
.ml-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ml-id { min-width: 0; }
.ml-name {
    font-family: "Bebas Neue", sans-serif; font-weight: 400; letter-spacing: .05em;
    font-size: 1.2rem; line-height: 1; margin: 0; color: var(--ml-ink);
}
.ml-project { font-size: .78rem; color: var(--ml-muted); margin: 5px 0 0; letter-spacing: .02em; }

/* Slider controls (arrows + dots) */
.ml-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 10px; }
.ml-controls[hidden] { display: none; }
.ml-arrow {
    width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
    background: var(--ml-ink); color: var(--ml-paper); border: 1px solid var(--ml-ink);
    font-size: 1.5rem; line-height: 1; display: flex; align-items: center; justify-content: center;
    transition: .4s var(--ml-ease);
}
.ml-arrow:hover { background: transparent; color: var(--ml-ink); }
.ml-arrow:disabled { opacity: .3; cursor: default; background: transparent; color: var(--ml-ink); }

.ml-dots { display: flex; gap: 9px; align-items: center; }
.ml-dot {
    width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
    background: var(--ml-line); transition: .3s var(--ml-ease);
}
.ml-dot.on { background: var(--ml-gold); width: 26px; border-radius: 5px; }

.ml-empty { text-align: center; color: var(--ml-muted); padding: 40px 0; font-size: 1rem; }
.ml-empty[hidden] { display: none; }

/* Newly added card flash-in animation */
.ml-card.ml-new { animation: mlIn .7s var(--ml-ease); }
@keyframes mlIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------- RESPONSIVE -- */
@media (max-width: 1024px) { .ml-slider { --ml-card-w: 320px; } }
@media (max-width: 600px) {
    .ml-slider { --ml-card-w: 84vw; }
    .ml-arrow { width: 46px; height: 46px; }
}
