/* ==========================================================================
   Wedding Reservation System - Frontend Styles
   ========================================================================== */

:root {
  --wr-primary:       #8b6f4e;
  --wr-primary-dark:  #6d5540;
  --wr-primary-light: #f5efe8;
  --wr-gold:          #c5a96c;
  --wr-text:          #333;
  --wr-text-muted:    #888;
  --wr-border:        #e8e0d8;
  --wr-radius:        10px;
  --wr-shadow:        0 4px 20px rgba(0,0,0,.08);
}

/* Widget wrapper */
.wr-widget {
  max-width: 720px;
  margin: 0 auto;
  font-family: 'ヒラギノ角ゴ ProN', 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
  color: var(--wr-text);
  line-height: 1.7;
}

/* Form note */
.wr-form-note {
  background: var(--wr-primary-light);
  border-left: 4px solid var(--wr-primary);
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--wr-text);
  margin-bottom: 28px;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   Step Indicator
   -------------------------------------------------------------------------- */
.wr-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
  gap: 0;
}

.wr-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: .45;
  transition: opacity .2s;
  min-width: 56px;
}

.wr-step.wr-step--active,
.wr-step.wr-step--done {
  opacity: 1;
}

.wr-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  transition: background .2s;
}

.wr-step.wr-step--active .wr-step-num {
  background: var(--wr-primary);
}

.wr-step.wr-step--done .wr-step-num {
  background: var(--wr-gold);
}

.wr-step-label {
  font-size: 11px;
  color: var(--wr-text-muted);
  white-space: nowrap;
}

.wr-step.wr-step--active .wr-step-label {
  color: var(--wr-primary);
  font-weight: bold;
}

.wr-step-arrow {
  width: 32px;
  height: 2px;
  background: var(--wr-border);
  margin-bottom: 20px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Step Content
   -------------------------------------------------------------------------- */
.wr-step-content {
  display: none;
  animation: wrFadeIn .3s ease;
}

.wr-step-content.wr-step-content--active {
  display: block;
}

@keyframes wrFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wr-step-title {
  font-size: 18px;
  font-weight: normal;
  color: var(--wr-primary);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--wr-primary-light);
}

.wr-back-btn {
  display: inline-block;
  background: none;
  border: none;
  color: var(--wr-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
  text-decoration: underline;
}

.wr-back-btn:hover {
  color: var(--wr-primary);
}

.wr-selected-label {
  background: var(--wr-primary-light);
  color: var(--wr-primary-dark);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */
.wr-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.wr-nav-btn {
  background: none;
  border: 1px solid var(--wr-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  color: var(--wr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  line-height: 1;
  padding: 0;
}

.wr-nav-btn:hover {
  background: var(--wr-primary);
  color: #fff;
}

.wr-month-label {
  font-size: 20px;
  color: var(--wr-text);
  font-weight: normal;
  min-width: 140px;
  text-align: center;
}

/* Calendar grid */
.wr-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.wr-cal-header {
  text-align: center;
  font-size: 12px;
  color: var(--wr-text-muted);
  padding: 8px 0;
  font-weight: bold;
}

.wr-cal-header:first-child  { color: #c0392b; }
.wr-cal-header:last-child   { color: #2980b9; }

.wr-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  cursor: default;
  transition: background .15s, transform .1s;
  position: relative;
  border: 2px solid transparent;
}

/* Empty cells */
.wr-cal-empty {
  aspect-ratio: 1;
}

/* Available */
.wr-cal-day--available {
  background: #fff;
  border-color: var(--wr-border);
  color: var(--wr-text);
  cursor: pointer;
}

.wr-cal-day--available:hover {
  background: var(--wr-primary-light);
  border-color: var(--wr-primary);
  transform: scale(1.05);
}

/* Full */
.wr-cal-day--full {
  background: #fdf0f0;
  border-color: #f5c6c6;
  color: #c0a0a0;
  cursor: not-allowed;
}

/* Closed */
.wr-cal-day--closed {
  background: #f5f5f5;
  color: #ccc;
  cursor: not-allowed;
}

/* Past / Far */
.wr-cal-day--past,
.wr-cal-day--far {
  background: transparent;
  color: #ddd;
  cursor: not-allowed;
}

/* Today */
.wr-cal-day--today {
  border-color: var(--wr-gold) !important;
  font-weight: bold;
}

/* Selected */
.wr-cal-day--selected {
  background: var(--wr-primary) !important;
  border-color: var(--wr-primary) !important;
  color: #fff !important;
  font-weight: bold;
}

/* Weekends color */
.wr-cal-day.wr-cal-sun { color: #c0392b; }
.wr-cal-day.wr-cal-sat { color: #2980b9; }

/* Legend */
.wr-calendar-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.wr-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--wr-text-muted);
}

.wr-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid transparent;
}

.wr-legend-dot--available { background: #fff; border-color: var(--wr-border); }
.wr-legend-dot--full      { background: #fdf0f0; border-color: #f5c6c6; }
.wr-legend-dot--closed    { background: #f5f5f5; }

/* Loading */
.wr-loading {
  text-align: center;
  padding: 40px;
  color: var(--wr-text-muted);
  font-size: 14px;
}

.wr-loading::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--wr-border);
  border-top-color: var(--wr-primary);
  border-radius: 50%;
  animation: wrSpin .7s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes wrSpin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Time Slots
   -------------------------------------------------------------------------- */
.wr-time-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wr-slot-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border: 2px solid var(--wr-border);
  border-radius: var(--wr-radius);
  background: #fff;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  width: 100%;
}

.wr-slot-btn:hover {
  border-color: var(--wr-primary);
  background: var(--wr-primary-light);
}

.wr-slot-btn:disabled {
  background: #f9f9f9;
  color: #ccc;
  border-color: #eee;
  cursor: not-allowed;
}

.wr-slot-icon {
  display: none;
}

.wr-slot-time {
  font-size: 20px;
  font-weight: bold;
  color: var(--wr-primary);
}

.wr-slot-btn:disabled .wr-slot-time {
  color: #ccc;
}

.wr-slot-note {
  font-size: 12px;
  color: var(--wr-text-muted);
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
#wr-booking-form {
  max-width: 100%;
}

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

.wr-field label {
  display: block;
  font-size: 14px;
  color: var(--wr-text);
  margin-bottom: 6px;
  font-weight: bold;
}

.wr-field--required > label::after {
  content: ' ※';
  color: #c0392b;
  font-size: 12px;
}

.wr-optional {
  font-size: 11px;
  color: var(--wr-text-muted);
  font-weight: normal;
  background: #f0f0f0;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}

.wr-field input[type="text"],
.wr-field input[type="email"],
.wr-field input[type="tel"],
.wr-field textarea,
.wr-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--wr-border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  color: var(--wr-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.wr-field input:focus,
.wr-field textarea:focus,
.wr-field select:focus {
  outline: none;
  border-color: var(--wr-primary);
  box-shadow: 0 0 0 3px rgba(139,111,78,.15);
}

.wr-field input.wr-input-error,
.wr-field textarea.wr-input-error {
  border-color: #e74c3c;
}

.wr-error {
  display: block;
  font-size: 12px;
  color: #e74c3c;
  margin-top: 4px;
}

.wr-error:empty {
  display: none;
}

.wr-radio-group {
  display: flex;
  gap: 20px;
  margin-top: 4px;
}

.wr-field .wr-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: normal;
  margin-bottom: 0;
}

.wr-field .wr-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0 3px;
  accent-color: var(--wr-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.wr-wedding-selects {
  display: flex;
  gap: 10px;
}

.wr-wedding-selects select {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.wr-btn-primary {
  width: 230px;
  margin: 8px auto 0;
  display: block;
  background: var(--wr-primary);
  color: #fff;
  border: none;
  padding: 16px 40px;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: .06em;
  transition: background .2s, transform .1s;
}

.wr-btn-primary:hover {
  background: var(--wr-primary-dark);
}

.wr-btn-primary:active {
  transform: scale(.98);
}

.wr-btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Confirmation Table
   -------------------------------------------------------------------------- */
.wr-confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  background: var(--wr-primary-light);
  border-radius: var(--wr-radius);
  overflow: hidden;
}

.wr-confirm-table th {
  width: 140px;
  padding: 14px 18px;
  text-align: left;
  font-size: 13px;
  color: var(--wr-text-muted);
  font-weight: normal;
  border-bottom: 1px solid var(--wr-border);
  vertical-align: top;
}

.wr-confirm-table td {
  padding: 14px 18px;
  font-size: 15px;
  color: var(--wr-text);
  border-bottom: 1px solid var(--wr-border);
}

.wr-confirm-table tr:last-child th,
.wr-confirm-table tr:last-child td {
  border-bottom: none;
}

.wr-submit-error {
  background: #fde8e8;
  border: 1px solid #f5c6c6;
  color: #c0392b;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Complete
   -------------------------------------------------------------------------- */
.wr-complete {
  text-align: center;
  padding: 48px 24px;
}

.wr-complete-icon {
  width: 72px;
  height: 72px;
  background: var(--wr-gold);
  color: #fff;
  border-radius: 50%;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.wr-complete-title {
  font-size: 22px;
  font-weight: normal;
  color: var(--wr-primary);
  margin: 0 0 20px;
}

.wr-complete-body {
  max-width: 480px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--wr-text-muted);
  line-height: 1.9;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .wr-step-arrow { width: 16px; margin-bottom: 0; }
  .wr-step-label { display: none; }
  .wr-cal-day    { font-size: 12px; border-radius: 4px; }
  .wr-month-label { font-size: 16px; min-width: 110px; }
  .wr-confirm-table th { width: 100px; }
  .wr-btn-primary { width: 100%; }
  .wr-wedding-selects { flex-direction: column; }
}
