:root {
  --bg: #0F0C0E;
  --text: #E5D9C4;
  --accent: #800020;
  --gold: #D4AF37;
  --glass: rgba(229, 217, 196, 0.08);
  --glass-border: rgba(212, 175, 55, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(128, 0, 32, 0.45), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(212, 175, 55, 0.12), transparent 50%),
    linear-gradient(165deg, #1a1014 0%, var(--bg) 45%, #12090c 100%);
}

body {
  display: flex;
  justify-content: center;
  padding: 28px 16px 40px;
  position: relative;
  overflow-x: hidden;
}

/* dew drops */
.drops {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.drop {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), rgba(212,175,55,0.15) 45%, transparent 70%);
  box-shadow: inset 0 0 4px rgba(255,255,255,0.35);
  opacity: 0.55;
}

.wrap {
  width: min(420px, 100%);
  position: relative;
  z-index: 1;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 28px 22px 24px;
  box-shadow:
    0 20px 50px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.glass::before {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -20px;
  top: -25px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.4), transparent 65%);
  opacity: 0.5;
}

.glass h1 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-align: center;
}

.glass p.hint {
  margin: 0 0 20px;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(229, 217, 196, 0.82);
  text-align: center;
}

.glass form {
  text-align: center;
}

label {
  display: block;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  margin-bottom: 6px;
  color: rgba(212, 175, 55, 0.9);
  text-align: center;
}

input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(15, 12, 14, 0.55);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1rem;
  outline: none;
  margin-bottom: 16px;
  text-align: center;
}

input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

button.primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #9a1a3a 0%, var(--accent) 100%);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(128, 0, 32, 0.35);
}

button.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

button.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.links {
  margin-top: 18px;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: center;
}

.links a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
}

.error {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: #ff8fa3;
  min-height: 1.2em;
  margin: 0 0 10px;
  font-size: 0.88rem;
}

/* Phone: Country / Code / Number */
.phone-form #country {
  cursor: pointer;
  caret-color: transparent;
}

.phone-form #country::after {
  content: "";
}

.row-code-phone {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  gap: 10px;
  margin-bottom: 4px;
}

.field-code label,
.field-phone label {
  text-align: center;
}

.field-code input,
.field-phone input {
  margin-bottom: 16px;
}

body.modal-open {
  overflow: hidden;
}

.country-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 5, 7, 0.72);
  backdrop-filter: blur(4px);
}

.country-backdrop.is-open,
.country-modal.is-open {
  display: flex;
}

.country-modal[hidden],
.country-backdrop[hidden] {
  display: none !important;
}

.country-modal {
  display: none;
  flex-direction: column;
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  max-height: min(78vh, 640px);
  z-index: 50;
  background: rgba(22, 14, 18, 0.96);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.country-modal.is-open {
  display: flex;
}

.country-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.country-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold);
}

.country-close {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
}

.country-search-wrap {
  padding: 10px 14px 8px;
}

.country-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(15, 12, 14, 0.55);
}

.country-search-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.country-search-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(229, 217, 196, 0.55);
  border-radius: 50%;
  position: relative;
  opacity: 0.75;
}

.country-search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.5px;
  background: rgba(229, 217, 196, 0.55);
  right: -4px;
  bottom: -1px;
  transform: rotate(45deg);
  border-radius: 1px;
}

.country-search-box input {
  flex: 1;
  margin: 0;
  padding: 12px 0;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: left;
  min-width: 0;
}

.country-search-box input:focus {
  border: none;
  box-shadow: none;
}

.country-search-clear {
  flex: 0 0 auto;
  border: none;
  background: rgba(229, 217, 196, 0.18);
  color: var(--text);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  line-height: 1;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
}

.country-search-clear[hidden] {
  display: none !important;
}

.country-list {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
  overflow-y: auto;
  flex: 1;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

.country-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-top: 1px solid rgba(229, 217, 196, 0.06);
}

.country-item:hover,
.country-item.is-active {
  background: rgba(128, 0, 32, 0.28);
}

.country-name {
  text-align: left;
  color: var(--text);
}

.country-dial {
  color: rgba(212, 175, 55, 0.95);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
