/* Formularios y calendarios con la paleta de ORDENATE! */
:root {
  color-scheme: light;
  --field-surface: #fffdf8;
  --field-border: #d9d1bf;
  --field-border-hover: #b6aa91;
  --field-focus: #3d7757;
}

.field { min-width: 0; }
.field label { color: #485f53; font-size: 11px; font-weight: 800; letter-spacing: .015em; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.field select,
.field textarea,
.activity-add-form input,
.tarot-self-select,
.tarot-guest-form input,
.oracle-dialog-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--field-border);
  border-radius: 9px;
  background-color: var(--field-surface);
  color: #263f35;
  font: 500 13px/1.4 'DM Sans', Arial, sans-serif;
  color-scheme: light;
  box-shadow: inset 0 1px 1px #5a49300a;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.field input::placeholder,
.field textarea::placeholder { color: #9a9d8e; opacity: 1; }
.field input:hover:not(:disabled),
.field select:hover:not(:disabled),
.field textarea:hover:not(:disabled),
.tarot-self-select:hover,
.tarot-guest-form input:hover,
.oracle-dialog-form input:hover,
.activity-add-form input:hover { border-color: var(--field-border-hover); background-color: #fffefa; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.tarot-self-select:focus-visible,
.tarot-guest-form input:focus-visible,
.oracle-dialog-form input:focus-visible {
  border-color: var(--field-focus);
  outline: 0;
  box-shadow: 0 0 0 3px #3d775726;
}
.activity-add-form input:focus-visible { border-color: var(--field-focus); outline: 0; box-shadow: 0 0 0 3px #3d775726; }
.field input:disabled,
.field select:disabled,
.field textarea:disabled { cursor: not-allowed; opacity: .62; }

.field select,
.tarot-self-select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%235b7564' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
.field select option { background: #fffdf8; color: #263f35; }
.field textarea { min-height: 110px; resize: vertical; }
.field input[type="number"] { font-variant-numeric: tabular-nums; }
.field input[type="checkbox"], .check-field input { accent-color: #3d7757; }

.app-select-control { position: relative; width: 100%; min-width: 0; }
.app-select-value { position: absolute !important; z-index: -1; inset: 0 auto auto 0; width: 1px !important; min-width: 1px !important; height: 1px !important; min-height: 1px !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
.app-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--field-border);
  border-radius: 9px;
  background: var(--field-surface);
  color: #263f35;
  text-align: left;
  font: 500 13px/1.4 'DM Sans', Arial, sans-serif;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.app-select-trigger:hover:not(:disabled) { border-color: var(--field-border-hover); background: #fffefa; }
.app-select-trigger:focus-visible, .app-select-control.open .app-select-trigger { border-color: var(--field-focus); outline: 0; box-shadow: 0 0 0 3px #3d775726; }
.app-select-trigger:disabled { cursor: not-allowed; opacity: .62; }
.app-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-select-chevron { color: #7d8775; font-size: 17px; line-height: 1; transition: transform .16s ease; }
.app-select-control.open .app-select-chevron { transform: rotate(180deg); }
.app-select-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: min(270px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid #ded5c2;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 12px 28px #2d352624, 0 2px 6px #59462a12;
}
.app-select-control.opens-up .app-select-popover { top: auto; bottom: calc(100% + 6px); }
.app-select-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #40594b; text-align: left; font: 500 12px/1.35 'DM Sans', Arial, sans-serif; cursor: pointer; }
.app-select-option:hover, .app-select-option:focus-visible { border-color: #e5e9db; outline: 0; background: #f3f5eb; }
.app-select-option.selected { background: #edf3e7; color: #2d6845; font-weight: 800; }
.app-select-option:disabled { color: #9b9c90; cursor: not-allowed; }
.app-select-check { flex: none; color: #3c7754; font-weight: 900; }

.app-date-control { position: relative; width: 100%; min-width: 0; }
.app-calendar-value {
  position: absolute !important;
  z-index: -1;
  inset: 0 auto auto 0;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.app-date-trigger {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid var(--field-border);
  border-radius: 9px;
  background: var(--field-surface);
  color: #263f35;
  text-align: left;
  font: 600 12px/1.35 'DM Sans', Arial, sans-serif;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.app-date-trigger:hover { border-color: var(--field-border-hover); background: #fffefa; }
.app-date-control.open .app-date-trigger,
.app-date-trigger:focus-visible { border-color: var(--field-focus); outline: 0; box-shadow: 0 0 0 3px #3d775726; }
.app-date-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 8px; background: #edf2e7; color: #3d7757; }
.app-date-icon .glyph { width: 17px; height: 17px; }
.app-date-label { min-width: 0; flex: 1; text-transform: capitalize; }
.app-date-chevron { color: #7d8775; font-size: 17px; line-height: 1; }

.app-calendar-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 50%;
  width: min(340px, calc(100vw - 38px));
  padding: 13px;
  border: 1px solid #ded5c2;
  border-radius: 13px;
  background: #fffdf8;
  box-shadow: 0 14px 34px #2d352629, 0 2px 7px #59462a12;
  transform: translateX(-50%);
  animation: calendar-enter .14s ease-out;
}
.app-date-control.opens-up .app-calendar-popover { top: auto; bottom: calc(100% + 8px); }
@keyframes calendar-enter { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
.app-calendar-head { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 6px; margin-bottom: 10px; }
.app-calendar-head strong { color: #294b3d; text-align: center; text-transform: capitalize; font: 800 13px/1.3 Manrope, sans-serif; }
.app-calendar-nav { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #e7dfce; border-radius: 9px; background: #f7f3e9; color: #315b46; font-size: 23px; line-height: 1; }
.app-calendar-nav:hover { border-color: #c8d5bd; background: #edf3e8; }
.app-calendar-grid, .app-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.app-calendar-weekday { display: grid; place-items: center; height: 26px; color: #8a8d7e; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.app-calendar-day { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #344d40; font: 600 11px 'DM Sans', Arial, sans-serif; }
.app-calendar-day:hover { border-color: #dae4d3; background: #f0f5eb; }
.app-calendar-day.outside { color: #a9a99a; }
.app-calendar-day.today { border-color: #9bb78b; color: #2e7048; font-weight: 900; }
.app-calendar-day.selected, .app-calendar-day.selected:hover { border-color: #315e45; background: #315e45; color: #fffdf8; font-weight: 900; }
.app-calendar-day:focus-visible, .app-month-choice:focus-visible, .app-calendar-nav:focus-visible, .app-calendar-foot button:focus-visible { outline: 2px solid #3d7757; outline-offset: 2px; }
.app-calendar-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid #eee7d9; color: #8b8d80; font-size: 10px; }
.app-calendar-foot button { padding: 6px 10px; border: 1px solid #d5e1cf; border-radius: 7px; background: #eff5e9; color: #356b49; font-size: 10px; font-weight: 800; }
.app-month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.app-month-choice { min-height: 43px; padding: 7px 4px; border: 1px solid #e7dfce; border-radius: 8px; background: #fffefa; color: #465d4e; font-size: 11px; text-transform: capitalize; }
.app-month-choice:hover { border-color: #c8d5bd; background: #f0f5eb; }
.app-month-choice.selected { border-color: #315e45; background: #315e45; color: #fffdf8; font-weight: 800; }

@media (max-width: 430px) {
  .app-calendar-popover { width: min(326px, calc(100vw - 34px)); padding: 11px; }
  .app-calendar-grid { gap: 2px; }
  .app-calendar-day { border-radius: 8px; }
}
@media (prefers-reduced-motion: reduce) { .app-calendar-popover { animation: none; } }
