/* ── Reset & Base ── */
*, ::before, ::after { box-sizing: border-box; }

:root {
  --primary:       #D4AF37;
  --primary-hover: #B5952F;
  --bg-light:      #F8F9FA;
  --surface-light: #FFFFFF;
  --text-main:     #333333;
  --text-muted:    #666666;
  --gray-100:      #f3f4f6;
  --gray-200:      #e5e7eb;
  --gray-400:      #9ca3af;
  --gray-500:      #6b7280;
  --gray-600:      #4b5563;
  --gray-900:      #111827;
  --azure-blue:    #007FFF;
}

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: rgb(248 249 250 / var(--tw-bg-opacity, 1));
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  height: auto !important;
}

#wrapper {
  height: auto !important;
  background-color: rgb(248 249 250 / var(--tw-bg-opacity, 1));
}

/* ════════════════════════════
   MAIN
════════════════════════════ */
.ref-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background-color: rgb(248 249 250 / var(--tw-bg-opacity, 1));
}

/* ════════════════════════════
   CARD
════════════════════════════ */
.ref-card {
  width: 100%;
  max-width: 64rem;
  background: var(--surface-light);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 650px;
}
@media (min-width: 768px) {
  .ref-card { flex-direction: row; }
}

/* ── Left: Image ── */
.ref-img-panel {
  width: 100%;
  position: relative;
  background-color: var(--azure-blue);
  overflow: hidden;
  min-height: 280px;
}
@media (min-width: 768px) {
  .ref-img-panel { width: 50%; min-height: unset; }
}
.ref-img-panel img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(1.35) contrast(1.1) saturate(1.4) hue-rotate(-5deg);
  transition: transform 0.7s;
}
.ref-img-panel:hover img { transform: scale(1.05); }
.ref-img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent, transparent);
}
.ref-img-text {
  position: absolute;
  bottom: 0; left: 0;
  padding: 2.5rem;
  color: #fff;
  z-index: 10;
}
.ref-img-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.25;
  filter: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
}
.ref-img-desc {
  font-size: 1.125rem;
  line-height: 1.625;
  font-weight: 300;
  font-family: 'Inter', sans-serif;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.05));
}

/* ── Right: Form ── */
.ref-form-panel {
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface-light);
}
@media (min-width: 768px) {
  .ref-form-panel { width: 50%; padding: 3rem; }
}
.ref-form-inner {
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ref-form-inner.is-email-mode {
  gap: 0.5rem;
}

/* Heading */
.ref-heading-wrap { margin-bottom: 0; text-align: center; }
.ref-heading-wrap h1 {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.ref-heading-wrap p {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

/* Alerts */
.ref-alert {
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}
.ref-alert-danger { background: #fff4f4; border: 1px solid #f2caca; color: #b54747; }
.ref-alert-info   { background: #eef6ff; border: 1px solid #c8dff9; color: #2c5d8f; }

/* Buttons — matching .btn-secondary exactly */
.ref-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--surface-light);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  color: rgb(51 51 51 / var(--tw-text-opacity, 1));
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.3s ease, background-color 0.15s;
  line-height: 1.5;
}
.ref-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  text-decoration: none;
}
.ref-btn .material-icons {
  color: var(--gray-600);
  font-size: 1.25rem;
}
.ref-btn .fa-apple {
  font-size: 1.25rem;
  color: var(--gray-900);
}

/* Divider */
.ref-divider {
  display: flex;
  padding: 0.25rem 0;
  align-items: center;
}
.ref-divider-line {
  flex-grow: 1;
  border-top: 1px solid var(--gray-200);
  height: 0;
}
.ref-divider-text {
  flex-shrink: 0;
  margin: 0 1rem;
  color: var(--gray-400);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
}

/* Email form */
#emailLoginSection { margin-top: -0.5rem; }
.ref-email-fields { display: flex; flex-direction: column; gap: 1rem; }

.ref-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(51 51 51 / var(--tw-text-opacity, 1));
  margin-bottom: 0.375rem;
}
.ref-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ref-input:hover {
  border-color: var(--primary);
}
.ref-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}
.ref-input-wrap { position: relative; }
.ref-input-wrap .eye-icon {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 18px; cursor: pointer; opacity: 0.45;
  transition: opacity 0.15s;
}
.ref-input-wrap .eye-icon:hover { opacity: 0.85; }

.ref-btn-submit {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  border: none;
  background-image: linear-gradient(to right, #E6D089, #D4AF37);
  color: rgb(61 43 31 / var(--tw-text-opacity, 1));
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
}
.ref-btn-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

/* Cancel */
.ref-cancel { padding-top: 1rem; text-align: center; }
.ref-cancel a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.ref-cancel a:hover { color: var(--primary); text-decoration: none; }

/* Back to login options link */
.ref-back-to-options {
  margin-top: 2rem;
  text-align: center;
}
.ref-back-to-options a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.ref-back-to-options a:hover {
  color: var(--primary);
  text-decoration: none;
}
.ref-back-to-options .material-icons {
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
  transform: translateY(1px);
  transition: transform 0.15s;
}
.ref-back-to-options a:hover .material-icons {
  transform: translate(-3px, 1px);
}

/* Social options wrapper spacing */
#socialLoginOptions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Label row with Forgot password */
.ref-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}
.ref-label-row .ref-label {
  margin-bottom: 0;
}
.ref-forgot-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}
.ref-forgot-link:hover {
  color: var(--primary-hover);
  text-decoration: none;
}
