@font-face {
  font-family: 'Montserrat';
  src: url('Montserrat-Bold.woff2') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

:root {
  --ink: #111111;
  --white: #ffffff;
  --accent: #111111;
  --field-border: #d8d8d8;
  --field-focus: #111111;
  --radius: 14px;
  font-family: 'Nunito', sans-serif;
}

* { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  min-height: 100dvh;
}

.page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 100px;
}

.logo {
  width: clamp(100px, 15vw, 460px);
  height: auto;
  display: block;
}

.mail-btn {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 12px;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 50px;
  border: none;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mail-btn:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.4);
}

.mail-btn:active {
  transform: translateX(-50%);
}

.mail-icon {
  width: 26px;
  height: 26px;
}

/* Overlay + Fixed Height Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  overflow: hidden;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal {
  background: var(--white);
  width: 100%;
  max-width: 510px;
  height: auto;
  max-height: calc(100dvh - 16px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px;
  padding: 16px 26px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transform: translateY(0);
  transition: transform 0.2s ease;
  margin: auto;
}

.overlay.hidden .modal {
  transform: translateY(16px);
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}

.close-btn:hover {
  color: var(--ink);
}

.modal h2 {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0 0 4px;
}

.modal-sub {
  margin: 0 0 12px;
  color: #666;
  font-size: 0.88rem;
}

form {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
}

/* Side-by-side multi-column rows */
.field-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.field {
  flex: 1 1 0px;
  min-width: 0;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

/* Prevents the message container from expanding vertically */
.field:has(textarea) {
  flex: none;
  margin-bottom: 20px;
}

.field label {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field input,
.field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  padding: 8px 12px;
  border: 1.5px solid var(--field-border);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Fixed textarea height to prevent pushing elements apart */
.field textarea {
  height: 120px;
  min-height: 80px;
}

.field input:hover,
.field textarea:hover {
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--field-focus);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.submit-btn {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  width: 100%;
  padding: 11px;
  margin-top: 0;
  margin-bottom: 0;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--white);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.submit-btn:hover {
  opacity: 0.88;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status:empty,
.verify-timer:empty {
  display: none;
  margin: 0;
  padding: 0;
}

.form-status {
  margin: 0 0 0px;
  font-size: 0.9rem;
  min-height: 0;
}

.form-status.success { color: #1a7f37; }
.form-status.error { color: #c0392b; }

.verify-timer {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #888;
  text-align: center;
}

.link-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  background: none;
  border: none;
  color: #111;
  text-decoration: underline;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
}

.link-btn.hidden {
  display: none;
}

/* Constrained Inline Verification Code Input */
.code-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.code-input-wrapper input {
  width: 100%;
  max-width: 100%;
  padding-right: 75px;
  text-overflow: ellipsis;
}

.inline-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #888;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  padding: 0;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.inline-btn:hover:not(:disabled) {
  color: var(--ink);
}

.inline-btn:disabled {
  cursor: not-allowed;
}

/* Compact padding adjustments for small viewports */
@media (max-width: 480px) {
  .modal {
    padding: 16px 18px;
  }

  .field-row {
    gap: 8px;
  }

  .field input {
    font-size: 0.85rem;
    padding: 8px 6px;
  }

  .code-input-wrapper input {
    padding-right: 65px;
  }

  .inline-btn {
    font-size: 0.68rem;
    right: 6px;
  }
}