@import "./root.css";

/* ===== BASE ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cormorant Garamond", serif;

  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;

}

/* Background layer */
body::before {
  content: "";
  position: fixed;
  inset: 0;

  background: url("https://previews.123rf.com/images/ksena32/ksena321905/ksena32190500533/123738244-texture-of-the-material-of-the-wedding-dress.jpg")
    center / cover no-repeat;

  filter: blur(2px);
  transform: scale(1.05); /* prevents edge clipping */
  z-index: -1;
}

/* ===== CONTAINER ===== */
.auth-container {
  width: 100%;
  max-width: 520px;
  padding: 10px 36px;
  background: rgba(255,255,255,0.65);
  border-radius: 32px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.15);
}

/* ===== LOGO ===== */
.auth-logo {
  display: block;
  margin: 0 auto 28px;
  max-width: 180px;
  width: 100%;
  height: auto;
}

/* ===== SWITCH ===== */
.auth-switch {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 34px;
}

.auth-switch button {
  background: none;
  border: none;
  padding: 8px 24px;
  font-size: 18px;
  border-radius: 30px;
  cursor: pointer;
  color: var(--brown);
  transition: 0.3s ease;
}

.auth-switch button.active {
  background: var(--gold);
  font-weight: 700;
}

/* ===== FORM ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}


.auth-form.hidden {
  display: none;
}

/* ===== GROUPS ===== */
.form-row {
  display: flex;
  gap: 18px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 15px;
  font-weight: 600;
  color: var(--brown);
}

/* ===== INPUT ===== */
input {
  padding: 14px 18px;
  border-radius: 30px;
  border: 1px solid #ddd;
  font-size: 16px;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ===== BUTTON ===== */
.auth-btn {
  margin-top: 10px;
  padding: 15px;
  border-radius: 30px;
  border: none;
  background: var(--gold);
  color: var(--brown);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s ease;
}

.auth-btn:hover {
  background: white;
}

/* ===== MOBILE ===== */
@media (max-width: 520px) {
  .form-row {
    flex-direction: column;
  }
}


/* ===== SAUDI PHONE INPUT ===== */
.phone-input {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ddd;
  border-radius: 30px;
  padding: 0 14px;
  min-height: 48px;
  background: white;
  overflow: visible;
}

.phone-input:focus-within {
  border-color: var(--gold);
}

.country-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: max-content;
  font-size: 15px;
  font-weight: 600;
  color: var(--brown);
  margin-right: 4px;
  white-space: nowrap;
}

.country-flag img {
  width: 20px;
  height: auto;
  border-radius: 2px;
}

.dial-code {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
}

.phone-input input {
  border: none;
  outline: none;
  padding: 0;
  height: 100%;
  font-size: 16px;
  flex: 1;
  font-family: inherit;
}

/* ===== PASSWORD TOGGLE ===== */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 46px; /* space for eye */
}

.toggle-password {
  position: absolute;
  right: 18px;
  cursor: pointer;
  font-size: 16px;
  color: var(--brown);
  opacity: 0.6;
  user-select: none;
  transition: opacity 0.2s ease;
}

.toggle-password:hover {
  opacity: 1;
}

.toggle-password i.fa-eye {
  display: none;
}

.toggle-password i {
  cursor: pointer;
}

.password-rules {
  margin-top: 8px;
  font-size: 13px;
}

.password-rules p {
  margin: 4px 0;
  color: #999;
}

.password-rules p.valid {
  color: #2e7d32; /* green */
}

.password-rules p.invalid {
  color: #c62828; /* red */
}

button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== EMAIL VALIDATION ===== */
input.email-invalid {
  border: 2px solid #c62828; /* red */
}


/* ===== BUTTON LOADER ===== */
.auth-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.auth-btn .btn-loader {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.forget {
  text-decoration: none;
  color: var(--brown);
  font-size: large;
}

.forget:hover {
  color: var(--gold);
}