/* ================================================
   login-modal.css
   Mobile-first login popup styles for Aurexia
   ================================================ */

/* ---------- Overlay ---------- */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.login-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* ---------- Modal box ---------- */
.login-modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1rem;
  width: 100%;
  max-width: 420px;
  max-height: 85dvh;      /* tighter — bottom clip fix */
  overflow-y: auto;
  overflow-x: hidden;     /* reCAPTCHA horizontal overflow fix */
  box-sizing: border-box;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* Smooth entrance */
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.login-modal.is-open .login-modal-box {
  transform: translateY(0);
}

/* ---------- Close button ---------- */
.login-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.login-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

/* ---------- Title ---------- */
.login-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: #1a1a1a;
  padding-right: 2rem; /* close button overlap avoid */
}

/* ---------- Steps ---------- */
.login-step {
  width: 100%;
}

/* hidden attribute use chesina step space teesukోకూడదు */
.login-step[hidden] {
  display: none !important;
}

/* ---------- Form rows ---------- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.login-form-row label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 5px;
}

/* ---------- Inputs & Select ---------- */
.login-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 16px;        /* iOS auto-zoom prevent: 16px+ zaruri! */
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.login-input:focus {
  border-color: #0CA48C;
  background: #fff;
}

/* ---------- Submit button ---------- */
.login-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0CA48C 0%, #036AA9 100%);
  color: #fff;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.login-submit:hover {
  background: linear-gradient(135deg, #0b9380 0%, #025a8a 100%);
  opacity: 0.92;
}

.login-submit:active {
  transform: scale(0.98);
}

/* ---------- Back button ---------- */
.login-back {
  width: 100%;
  padding: 9px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #0CA48C;
  border-radius: 8px;
  background: transparent;
  color: #0CA48C;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, color 0.15s;
}

.login-back:hover {
  background: #f0faf8;
}

/* ---------- Phone display (step 2) ---------- */
.login-phone-display {
  font-size: 14px;
  color: #555;
  margin: 0 0 14px;
}

/* ---------- Error message ---------- */
.login-form-error {
  font-size: 13px;
  color: #c0392b;
  margin: -6px 0 10px;
  padding: 8px 10px;
  background: #fdf0ee;
  border-radius: 6px;
  border-left: 3px solid #c0392b;
}

/* ---------- reCAPTCHA container ---------- */
/* invisible recaptcha — layout space teesukokunda completely hide cheseyyi */
#recaptcha-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Small phones (max 360px) ---------- */
@media (max-width: 360px) {
  .login-modal {
    padding: 0.5rem;
  }

  .login-modal-box {
    padding: 1rem 0.875rem 0.875rem;
    border-radius: 12px;
    max-height: 88dvh;
  }

  .login-modal-title {
    font-size: 17px;
    margin-bottom: 0.875rem;
  }

  .login-input {
    padding: 9px 11px;
    font-size: 15px;
  }

  .login-submit {
    padding: 10px;
    font-size: 14px;
  }
}

/* ---------- Very small phones (max 320px) ---------- */
@media (max-width: 320px) {
  .login-modal-box {
    padding: 1rem 0.875rem;
  }
}