/* =========================================================
   MARVELLOUS EXPERIENCES - testimonials / reviews
   Uses the variables and breakpoints defined in style.css.
   ========================================================= */

/* ---------- Shared ---------- */
.tm-star-on  { color: var(--accent); }
.tm-star-off { color: #cfcfcf; }
.tm-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.tm-button {
  display: inline-block; background: var(--accent); color: var(--white); border: 0; border-radius: 3px;
  padding: 12px 30px; font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .5px;
  cursor: pointer; transition: background .3s;
}
.tm-button:hover, .tm-button:focus-visible { background: var(--accent-dark); color: var(--white); }

/* ---------- Home page section ---------- */
.tm-average { margin: 22px auto 0; color: var(--muted); font-size: 16px; }
.tm-average .tm-avg-stars { font-size: 20px; letter-spacing: 2px; margin-right: 8px; vertical-align: -1px; }
.tm-average strong { color: var(--text); }

.tm-grid { text-align: left; }
.tm-card {
  margin: 0; background: var(--white); border-top: 3px solid var(--accent);
  padding: 30px 26px 26px; box-shadow: 0 2px 10px rgba(0,0,0,.05);
  display: flex; flex-direction: column;
}
.tm-card-stars { font-size: 18px; letter-spacing: 2px; line-height: 1; margin-bottom: 16px; }
.tm-comment { margin: 0 0 22px; flex: 1 1 auto; color: var(--text); font-size: 15px; word-wrap: break-word; overflow-wrap: break-word; }
.tm-comment p { margin: 0; }
.tm-author { padding-top: 16px; border-top: 1px solid #eee; font-size: 13px; line-height: 1.5; }
.tm-name { display: block; color: var(--text); font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.tm-origin, .tm-service { display: block; color: var(--muted); }
.tm-service { font-style: italic; }

.tm-cta { margin: 50px 0 0; }

/* ---------- Review form page (valoraciones/index.php) ---------- */
.tm-page { max-width: 720px; }
.tm-intro { color: var(--muted); font-size: 16px; margin: 0 0 30px; }

.tm-form { margin: 0; }
.tm-field { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.tm-field label, .tm-field legend { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; padding: 0; }
.tm-optional { font-weight: 400; color: var(--muted); }
.tm-req { color: var(--accent); }
.tm-hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

.tm-form input[type="text"],
.tm-form input[type="email"],
.tm-form input[type="password"],
.tm-form textarea {
  display: block; width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; /* 16px avoids zoom on iOS */
  color: var(--text); background: var(--white); border: 1px solid #cfcfcf; border-radius: 3px;
  transition: border-color .2s, box-shadow .2s;
}
.tm-form textarea { min-height: 160px; resize: vertical; }
.tm-form input:focus, .tm-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(125,119,5,.18); }
.tm-form [aria-invalid="true"] { border-color: #b3261e; }
.tm-error { display: block; margin-top: 6px; color: #b3261e; font-size: 13px; font-weight: 500; }

.tm-alert { padding: 14px 18px; margin: 0 0 26px; border-left: 3px solid #b3261e; background: #fbeceb; color: #6b1a14; font-size: 14px; }
.tm-alert p { margin: 0; }
.tm-alert-ok { border-left-color: var(--accent); background: #f4f3e3; color: var(--text); }

/* Clickable stars (CSS only): the inputs are in reverse order (5..1) and shown left to right */
.tm-stars { position: relative; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.tm-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tm-stars label {
  display: block; margin: 0; padding: 0 4px; font-size: 40px; line-height: 1; font-weight: 400;
  color: #cfcfcf; cursor: pointer; transition: color .15s;
}
.tm-stars label:first-of-type { padding-right: 0; }
.tm-stars input:checked ~ label { color: var(--accent); }
.tm-stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .tm-stars:hover input:checked ~ label { color: #cfcfcf; }
  .tm-stars:hover label:hover,
  .tm-stars:hover label:hover ~ label { color: var(--accent); }
}

.tm-check { display: flex; gap: 12px; align-items: flex-start; }
.tm-check input { flex: 0 0 auto; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); }
.tm-check label { font-weight: 400; font-size: 14px; margin: 0; }
.tm-check label a { text-decoration: underline; }

/* Honeypot: hidden from people, visible to bots that fill every field */
.tm-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.tm-actions { margin-top: 30px; }
.tm-required-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

.tm-thanks { font-size: 16px; }
.tm-thanks p { margin: 0 0 24px; }

@media (max-width: 560px) {
  .tm-page { padding-top: 120px; }
  .tm-stars label { font-size: 44px; padding: 0 3px; }
  .tm-actions .tm-button { width: 100%; padding: 14px 20px; }
}

/* ---------- Admin panel (valoraciones/admin.php, internal) ---------- */
.tm-admin { background: var(--grey); min-height: 100vh; }
.tm-admin-header { background: var(--green); color: var(--white); }
.tm-admin-header .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.tm-admin-header h1 { font-size: 18px; letter-spacing: .5px; }
.tm-admin-main { padding: 30px 0 60px; }
.tm-admin-box { background: var(--white); padding: 26px; box-shadow: 0 2px 10px rgba(0,0,0,.05); margin-bottom: 26px; }
.tm-admin-login { max-width: 420px; margin: 60px auto; }
.tm-admin-login h2 { font-size: 20px; margin-bottom: 18px; }
.tm-admin-summary { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; font-size: 14px; }
.tm-admin-summary strong { font-size: 22px; display: block; color: var(--text); }
.tm-admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tm-admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.tm-admin-table th, .tm-admin-table td { padding: 10px 8px; border-bottom: 1px solid #e6e6e6; text-align: left; vertical-align: top; }
.tm-admin-table th { background: #fafafa; font-weight: 700; white-space: nowrap; }
.tm-admin-table tr.tm-hidden-row td { background: #fbfbf4; color: var(--muted); }
.tm-admin-table .tm-col-comment { min-width: 280px; max-width: 420px; white-space: pre-line; word-wrap: break-word; overflow-wrap: break-word; }
.tm-admin-table form { display: inline-block; margin: 0 4px 4px 0; }
.tm-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tm-badge-on  { background: #e7f2e3; color: #2d5a1f; }
.tm-badge-off { background: #eee; color: #555; }
.tm-btn-small { padding: 6px 12px; font-size: 12px; }
.tm-btn-light { background: #6b6f75; }
.tm-btn-light:hover { background: #4f5257; }
.tm-btn-danger { background: #b3261e; }
.tm-btn-danger:hover, .tm-btn-danger:focus-visible { background: #8c1d17; }
.tm-pagination { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; font-size: 14px; }
.tm-pagination a, .tm-pagination span { padding: 6px 12px; background: var(--white); border: 1px solid #ddd; border-radius: 3px; }
.tm-pagination .tm-current { background: var(--accent); border-color: var(--accent); color: var(--white); }
