/* ============================================================
   RESET & TOKENS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f2f4f7;
  color: #1c1e2a;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

:root {
  --navy:      #1e3a6e;
  --navy-dark: #12274d;
  --navy-mid:  #2a4fa3;
  --navy-light:#c3d4f0;
  --navy-pale: #eef3fc;

  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white:    #ffffff;

  --success:        #166534;
  --success-bg:     #f0fdf4;
  --success-border: #86efac;
  --error-color:    #dc2626;
  --error-bg:       #fef2f2;
  --error-border:   #fca5a5;

  --radius:    8px;
  --radius-lg: 14px;
  --shadow:    0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
  --t: 180ms ease;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

/* Emblem USMF */
.usmf-emblem {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.header-logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 2px;
}

.brand-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: .65rem;
  color: var(--gray-500);
  letter-spacing: .05em;
  font-weight: 600;
  text-transform: uppercase;
}

.header-session {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--navy-pale);
  border: 1px solid var(--navy-light);
  border-radius: 4px;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 500px) {
  .header-session { display: none; }
  .usmf-emblem { width: 38px; height: 38px; }
  .header-logo-img { height: 36px; }
  .brand-name { font-size: .95rem; }
  .brand-sub { display: none; }
}

/* ============================================================
   LAYOUT (Compactat)
   ============================================================ */
.page-main { padding: 24px 16px 40px; }

.form-wrap { max-width: 660px; margin: 0 auto; }

/* ============================================================
   FORM CARD (Compactat)
   ============================================================ */
.form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-card-head {
  background: var(--navy);
  padding: 20px 28px 16px;
  border-bottom: 3px solid var(--navy-mid);
}

.form-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.01em;
  line-height: 1.2;
  margin-bottom: 3px;
}

.form-subtitle {
  font-size: .74rem;
  color: rgba(255,255,255,.5);
  letter-spacing: .02em;
}

@media (max-width: 480px) {
  .form-card-head { padding: 18px 18px 14px; }
}

/* ============================================================
   FORM SECTIONS (Compactat)
   ============================================================ */
form {
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) { form { padding: 16px; } }

.form-section { padding: 14px 0; }

.section-title {
  font-family: 'Inter', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 12px;
}

.section-divider { border: none; border-top: 1px solid var(--gray-200); }

/* ============================================================
   FIELDS (Compactat)
   ============================================================ */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.field-row:last-child { margin-bottom: 0; }

@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; gap: 8px; } }

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field-group:last-child { margin-bottom: 0; }
.field-row .field-group { margin-bottom: 0; }
.field-group.hidden { display: none !important; }

.field-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

.req { color: #b91c1c; font-size: .85em; line-height: 1; }

/* Tooltip */
.tooltip-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  cursor: help;
  color: var(--gray-400);
  padding: 0;
  margin-left: 2px;
  line-height: 1;
}

.tooltip-popup {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  font-size: .7rem;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  max-width: 220px;
  text-align: center;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t);
  z-index: 20;
}

.tooltip-btn:hover .tooltip-popup,
.tooltip-btn:focus .tooltip-popup { opacity: 1; }

/* Inputs */
.field-input {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 7px 11px;
  font-size: .875rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
  line-height: 1.5;
}

.field-input::placeholder { color: var(--gray-400); }
.field-input:hover:not(:focus) { border-color: var(--gray-400); }
.field-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,110,.1); }
.field-input.is-error { border-color: var(--error-color); box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.field-input.is-valid { border-color: #16a34a; }

/* Select */
.select-wrap { position: relative; }
.field-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px; }
.select-chevron {
  position: absolute;
  right: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  transition: transform var(--t), color var(--t);
}
.select-wrap:focus-within .select-chevron {
  transform: translateY(-50%) rotate(180deg);
  color: var(--navy);
}

.field-hint { font-size: .7rem; color: var(--gray-400); }

.field-error {
  font-size: .72rem;
  color: var(--error-color);
  font-weight: 500;
  min-height: 14px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity var(--t), transform var(--t);
}
.field-error.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RADIO – CAZARE
   ============================================================ */
.cazare-question { display: flex; flex-direction: column; gap: 10px; }
.radio-group { display: flex; gap: 24px; flex-wrap: wrap; }
.radio-option { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.radio-input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.radio-custom {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--t);
}
.radio-custom::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--navy);
  transition: transform var(--t);
}
.radio-option:hover .radio-custom { border-color: var(--navy-mid); }
.radio-input:checked + .radio-custom { border-color: var(--navy); }
.radio-input:checked + .radio-custom::after { transform: translate(-50%, -50%) scale(1); }
.radio-text { font-size: .875rem; color: var(--gray-700); font-weight: 500; }

/* ============================================================
   CAZARE PERIOD
   ============================================================ */
.cazare-period {
  margin-top: 14px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.cazare-period.hidden { display: none; }

.cazare-period-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 12px;
}

.cazare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

@media (max-width: 480px) {
  .cazare-grid { grid-template-columns: 1fr; }
  .cazare-sep { flex-direction: row; justify-content: center; padding: 2px 0; }
  .cazare-sep svg { transform: rotate(90deg); }
}

.cazare-cell {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
}
.cazare-cell--exam { border-color: var(--navy-light); background: var(--navy-pale); }
.cazare-cell-label { display: block; font-size: .6rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 2px; }
.cazare-cell-value { display: block; font-family: 'Playfair Display', serif; font-size: .8rem; font-weight: 600; color: var(--navy-dark); margin-bottom: 1px; line-height: 1.3; }
.cazare-cell-note { display: block; font-size: .6rem; color: var(--gray-400); }
.cazare-sep { display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--gray-300); }
.cazare-nights { font-size: .62rem; font-weight: 700; color: var(--navy-mid); letter-spacing: .04em; white-space: nowrap; }
.cazare-summary { font-size: .74rem; color: var(--gray-500); text-align: center; padding-top: 8px; border-top: 1px solid var(--gray-200); line-height: 1.5; }

/* ============================================================
   FORM FOOTER / SUBMIT
   ============================================================ */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

.form-footer-note {
  display: flex; align-items: center; gap: 6px;
  font-size: .7rem; color: var(--gray-400);
  flex: 1; min-width: 160px; line-height: 1.4;
}
.form-footer-note svg { flex-shrink: 0; }

.btn-submit {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 11px 24px;
  font-size: .875rem; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--t), transform var(--t), box-shadow var(--t);
  white-space: nowrap;
}
.btn-submit:hover { background: var(--navy-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,58,110,.3); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:focus-visible { outline: 3px solid rgba(30,58,110,.35); outline-offset: 2px; }
.btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }

@media (max-width: 420px) {
  .form-footer { flex-direction: column; align-items: stretch; }
  .btn-submit { justify-content: center; }
}

/* ============================================================
   SUCCESS
   ============================================================ */
.success-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 48px 36px;
  text-align: center;
  animation: fadeUp .35s ease both;
}
.success-card.hidden { display: none; }

.success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  margin: 0 auto 22px;
  animation: scaleIn .35s cubic-bezier(.34,1.56,.64,1) .1s both;
}

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; font-weight: 700;
  color: var(--navy-dark); margin-bottom: 8px; letter-spacing: -.01em;
}
.success-desc { font-size: .875rem; color: var(--gray-500); max-width: 420px; margin: 0 auto 24px; line-height: 1.7; }

.success-summary {
  text-align: left;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px;
}
.success-row { display: flex; gap: 10px; font-size: .78rem; padding: 5px 0; border-bottom: 1px solid var(--gray-200); }
.success-row:last-child { border-bottom: none; }
.success-row-label { color: var(--gray-400); font-weight: 600; min-width: 130px; flex-shrink: 0; font-size: .7rem; letter-spacing: .03em; text-transform: uppercase; }
.success-row-value { color: var(--gray-800); font-weight: 500; }

.success-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

.btn-download {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 10px 18px; font-size: .82rem; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: all var(--t);
}
.btn-download:hover { background: var(--navy-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,58,110,.3); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--navy-light);
  border-radius: var(--radius); padding: 9px 20px;
  font-size: .82rem; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: all var(--t);
}
.btn-secondary:hover { background: var(--navy-pale); border-color: var(--navy-mid); }

/* ============================================================
   ERROR ALERT
   ============================================================ */
.error-alert {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--error-bg); border: 1px solid var(--error-border);
  border-radius: var(--radius); padding: 12px 14px; margin-top: 14px;
  animation: fadeUp .2s ease both;
}
.error-alert.hidden { display: none; }
.error-alert > svg { color: var(--error-color); flex-shrink: 0; margin-top: 1px; }
.error-alert strong { display: block; font-size: .82rem; color: #991b1b; margin-bottom: 2px; }
.error-alert p { font-size: .75rem; color: #7f1d1d; margin: 0; line-height: 1.5; }
.error-close { background: none; border: none; cursor: pointer; color: var(--error-color); font-size: 1.2rem; line-height: 1; padding: 0; margin-left: auto; flex-shrink: 0; opacity: .7; transition: opacity var(--t); }
.error-close:hover { opacity: 1; }

/* ============================================================
   LOADING
   ============================================================ */
.loading-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(255,255,255,.88); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.loading-overlay.hidden { display: none; }
.loading-box { display: flex; flex-direction: column; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 28px 36px; box-shadow: var(--shadow); }
.loading-box p { font-size: .82rem; color: var(--gray-500); font-weight: 500; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--gray-200); border-top-color: var(--navy); border-radius: 50%; animation: spin .85s linear infinite; }

/* ============================================================
   FOOTER – minimal
   ============================================================ */
.site-footer {
  background: var(--navy-dark);
  padding: 16px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .72rem;
  color: rgba(255,255,255,.35);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links a {
  color: rgba(255,255,255,.4);
  text-decoration: none;
  font-size: .72rem;
  transition: color var(--t);
}
.footer-links a:hover { color: rgba(255,255,255,.8); }
.footer-links span { color: rgba(255,255,255,.2); }

@media (max-width: 500px) {
  .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
}

/* ============================================================
   ADMIN MODAL (SECRET)
   ============================================================ */
.admin-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 31, 61, 0.7);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeUp .25s ease both;
}

.admin-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 31, 61, 0.25);
  width: 100%; max-width: 460px;
  padding: 28px;
  border: 1px solid var(--gray-200);
}

.admin-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--navy); margin-bottom: 8px;
}

.admin-desc {
  font-size: .8rem; color: var(--gray-500);
  line-height: 1.5; margin-bottom: 18px;
}

.admin-stats {
  display: flex; gap: 12px; margin-bottom: 18px;
}

.stat-card {
  flex: 1; background: var(--navy-pale);
  border: 1px solid var(--navy-light);
  border-radius: var(--radius); padding: 12px;
  text-align: center;
}

.stat-label {
  display: block; font-size: .65rem;
  font-weight: 700; text-transform: uppercase;
  color: var(--navy-mid); margin-bottom: 4px;
}

.stat-value {
  display: block; font-family: 'Playfair Display', serif;
  font-size: 1.75rem; font-weight: 700; color: var(--navy);
}

.admin-dashboard-links {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 20px;
}

.admin-dashboard-links .btn-download {
  justify-content: center; width: 100%; font-size: .82rem; padding: 10px;
}

.admin-danger-zone {
  border-top: 1px dashed var(--gray-300);
  padding-top: 14px; margin-top: 14px;
}

.danger-title {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; color: var(--error-color);
  margin-bottom: 8px; letter-spacing: .05em;
}

.admin-danger-zone button {
  width: 100%; justify-content: center; font-size: .8rem;
}

.admin-actions {
  display: flex; gap: 10px; margin-top: 14px;
}
.admin-actions button, .admin-actions a {
  flex: 1; justify-content: center; font-size: .82rem;
}

/* ============================================================
   ANIMATIONS & UTILS
   ============================================================ */
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes scaleIn { from { transform:scale(.4); opacity:0; } to { transform:scale(1); opacity:1; } }
@keyframes spin { to { transform:rotate(360deg); } }
.cazare-status-info {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 8px;
  display: inline-block;
  line-height: 1.4;
}
.cazare-status-info.available {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}
.cazare-status-info.unavailable {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-color);
}

.hidden { display: none !important; }
