/* ═══════════════════════════════════════════════════
   register.css — Estate Web Registration Pages
   Extends login.css design system.
   ═══════════════════════════════════════════════════ */

:root {
  --ink: #0d1117;
  --ink-soft: #1c2733;
  --ink-mid: #243447;
  --gold: #c19b76;
  --gold-lt: #d4b896;
  --gold-dk: #9a7655;
  --ivory: #faf8f4;
  --slate: #8a8f98;
  --success: #28a745;
  --danger: #dc3545;
  --border: rgba(255, 255, 255, .09);
  --shadow-gold: 0 8px 40px rgba(193, 155, 118, .2);
  --shadow-dark: 0 16px 56px rgba(13, 17, 23, .5);
  --radius: 16px;
  --radius-sm: 8px;
  --ease: all 0.26s ease;
  --display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --body: 'Poppins', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body);
  background: var(--ink);
  color: #fff;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}


/* ══════════════════════════════════════════════════
   MESSAGES
   ══════════════════════════════════════════════════ */
.messages-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  font-family: var(--body);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: none;
  box-shadow: var(--shadow-dark);
}


/* ══════════════════════════════════════════════════
   PAGE LAYOUT
   ══════════════════════════════════════════════════ */
.register-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  min-height: 100svh;
  position: relative;
}

.register-wrapper::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(193, 155, 118, .07) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(193, 155, 118, .05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.register-container {
  display: flex;
  width: 100%;
  max-width: 960px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-dark);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ══════════════════════════════════════════════════
   REGISTER CARD
   ══════════════════════════════════════════════════ */
.register-card {
  background: var(--ink-soft);
  flex: 1;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}


/* ══════════════════════════════════════════════════
   BRAND HEADER
   ══════════════════════════════════════════════════ */
.register-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--gold-dk), var(--gold));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--ink);
  margin: 0 auto 0.85rem;
  box-shadow: 0 4px 20px rgba(193, 155, 118, .3);
}

.brand-name {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.register-title {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.register-subtitle {
  font-size: 0.8rem;
  color: var(--slate);
  margin: 0;
}


/* ══════════════════════════════════════════════════
   ROLE SWITCHER — the key navigation improvement
   Three tabs: Customer / Agent / Company
   ══════════════════════════════════════════════════ */
.role-switcher {
  display: flex;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.role-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0.6rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--slate);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--body);
  transition: var(--ease);
  text-align: center;
  border: none;
  background: none;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.role-tab i {
  font-size: 1.1rem;
  display: block;
  margin-bottom: 2px;
}

.role-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}

.role-tab.active {
  background: var(--gold);
  color: var(--ink);
}

.role-tab.active i {
  color: var(--ink);
}

/* Label below the icon */
.role-tab-label {
  display: block;
}


/* ══════════════════════════════════════════════════
   ERROR ALERT
   ══════════════════════════════════════════════════ */
.error-alert {
  background: rgba(220, 53, 69, .1);
  border: 1.5px solid rgba(220, 53, 69, .3);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
}

.error-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fc8181;
  margin-bottom: 0.5rem;
}

.error-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.error-list li {
  font-size: 0.78rem;
  color: rgba(252, 129, 129, .85);
}


/* ══════════════════════════════════════════════════
   FORM
   ══════════════════════════════════════════════════ */
.register-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Full width fields */
.form-row.full {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-label i {
  color: var(--gold);
  font-size: 0.82rem;
}

/* Django renders form field inputs — we target them globally */
.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"],
.register-form select,
.register-form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, .05);
  border: 1.5px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.88rem;
  font-family: var(--body);
  outline: none;
  transition: var(--ease);
}

.register-form input::placeholder,
.register-form textarea::placeholder {
  color: rgba(255, 255, 255, .22);
}

.register-form input:focus,
.register-form select:focus,
.register-form textarea:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 3px rgba(193, 155, 118, .12);
}

/* Django adds id_* classes — target ul/li error markup */
.register-form ul {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
}

.register-form ul li {
  font-size: 0.72rem;
  color: #fc8181;
}

/* Helptext */
.register-form p.help-block,
.helptext {
  font-size: 0.7rem;
  color: var(--slate);
  margin: 0.2rem 0 0;
  line-height: 1.5;
}


/* ══════════════════════════════════════════════════
   SUBMIT BUTTON
   ══════════════════════════════════════════════════ */
.btn-submit {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  font-family: var(--body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--ease);
  margin-top: 0.5rem;
  letter-spacing: 0.3px;
}

.btn-submit:hover {
  background: var(--gold-lt);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}


/* ══════════════════════════════════════════════════
   LOGIN LINK (bottom of register)
   ══════════════════════════════════════════════════ */
.login-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.login-text {
  font-size: 0.8rem;
  color: var(--slate);
  margin: 0;
}

.btn-login {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  border: 1.5px solid var(--gold-dk);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.btn-login:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}


/* ══════════════════════════════════════════════════
   SIDE PANEL
   ══════════════════════════════════════════════════ */
.side-panel {
  display: none;
  width: 260px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.side-panel::before {
  content: 'EW';
  position: absolute;
  font-family: var(--display);
  font-size: 10rem;
  font-weight: 700;
  color: rgba(13, 17, 23, .08);
  bottom: -1.5rem;
  right: -1.5rem;
  line-height: 1;
  pointer-events: none;
  letter-spacing: -3px;
}

/* Each register page sets its own side-panel gradient via inline class */
.side-panel-customer {
  background: linear-gradient(160deg, #1a3c4e 0%, #2d5a73 100%);
}

.side-panel-agent {
  background: linear-gradient(160deg, var(--gold-dk) 0%, var(--gold) 100%);
}

.side-panel-company {
  background: linear-gradient(160deg, #16a34a 0%, #15803d 100%);
}

.side-content {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.side-content>i {
  font-size: 2.8rem;
  margin-bottom: 1.25rem;
  opacity: 0.75;
}

.side-panel-customer .side-content>i {
  color: rgba(255, 255, 255, .8);
}

.side-panel-agent .side-content>i {
  color: rgba(13, 17, 23, .6);
}

.side-panel-company .side-content>i {
  color: rgba(255, 255, 255, .8);
}

.side-content h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  line-height: 1.2;
}

.side-panel-customer .side-content h3,
.side-panel-company .side-content h3 {
  color: #fff;
}

.side-panel-agent .side-content h3 {
  color: var(--ink);
}

.side-content>p {
  font-size: 0.82rem;
  line-height: 1.75;
  margin-bottom: 1.75rem;
}

.side-panel-customer .side-content>p,
.side-panel-company .side-content>p {
  color: rgba(255, 255, 255, .6);
}

.side-panel-agent .side-content>p {
  color: rgba(13, 17, 23, .62);
}

.features {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.side-panel-customer .feature-item,
.side-panel-company .feature-item {
  color: rgba(255, 255, 255, .72);
}

.side-panel-agent .feature-item {
  color: rgba(13, 17, 23, .72);
}

.feature-item i {
  font-size: 0.85rem;
  margin-top: 1px;
  flex-shrink: 0;
}

.side-panel-customer .feature-item i {
  color: #86efac;
}

.side-panel-agent .feature-item i {
  color: var(--ink);
}

.side-panel-company .feature-item i {
  color: #bbf7d0;
}


/* ══════════════════════════════════════════════════
   Mobile (< 640px) — handle 5 tabs in role switcher
   ══════════════════════════════════════════════════ */
@media (max-width: 639px) {
  .role-switcher {
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    padding: 3px;
  }

  .role-tab {
    flex: 0 1 calc(33.333% - 3px);
    min-width: fit-content;
    padding: 0.5rem 0.35rem;
    font-size: 0.65rem;
  }

  .role-tab i {
    font-size: 0.95rem;
    margin-bottom: 1px;
  }

  .role-tab-label {
    font-size: 0.6rem;
  }
}

/* Very small screens — icons only, no text */
@media (max-width: 380px) {
  .role-tab {
    flex: 0 1 auto;
    padding: 0.45rem 0.3rem;
  }

  .role-tab-label {
    display: none;
  }

  .role-tab i {
    margin-bottom: 0;
  }
}


/* ══════════════════════════════════════════════════
   640px+ — desktop layout with side panel
   ══════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .side-panel {
    display: flex;
    align-items: center;
  }

  .register-card {
    padding: 2.5rem;
  }
}


/* ══════════════════════════════════════════════════
   900px+
   ══════════════════════════════════════════════════ */
@media (min-width: 900px) {
  .side-panel {
    width: 300px;
  }

  .register-card {
    padding: 3rem 2.75rem;
  }

  .register-title {
    font-size: 2rem;
  }

  .role-tab {
    flex-direction: row;
    font-size: 0.78rem;
    gap: 6px;
    padding: 0.65rem 0.75rem;
  }

  .role-tab i {
    font-size: 0.95rem;
    margin-bottom: 0;
  }
}


/* ══════════════════════════════════════════════════
   Reduced motion
   ══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ══════════════════════════════════════════════════
   GOOGLE BUTTON + OR DIVIDER
   ══════════════════════════════════════════════════ */
.gc-or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0;
}

.gc-or-divider::before,
.gc-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .1);
}

.gc-or-divider span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.gc-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.8rem 1.25rem;
  background: #ffffff;
  color: #1f1f1f;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--body);
  text-decoration: none;
  transition: all 0.22s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  cursor: pointer;
}

.gc-google-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
  transform: translateY(-1px);
  color: #1f1f1f;
}

.gc-google-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.gc-google-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   SECURITY NOTICE
   ══════════════════════════════════════════════════ */
.security-notice {
  background: rgba(193, 155, 118, 0.08);
  border: 1px solid rgba(193, 155, 118, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.security-notice i {
  color: var(--gold);
  font-size: 1.1rem;
  margin-top: 1px;
}

.security-notice strong {
  color: var(--gold);
  font-weight: 600;
}