/* ============================================================
   One F Stop — Member Area Styles
   ============================================================ */

/* ── Auth pages (register / login / reset) ─────────────────── */
.member-auth-section {
  min-height: calc(100vh - var(--nav-height) - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
}

.member-auth-box {
  width: 100%;
  max-width: 600px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3rem 2.5rem;
}

.member-auth-box--narrow { max-width: 440px; }

.member-auth-logo {
  height: 52px;
  width: auto;
  display: block;
  margin: 0 auto 1.5rem;
  object-fit: contain;
}

.member-auth-box h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--white);
  text-align: center;
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.member-auth-subtitle {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.06em;
}

.member-auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.optional {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.member-complete-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 2rem;
}

.optional-field {
  position: relative;
  width: 100%;
}

.optional-field > input,
.optional-field > textarea {
  padding-right: 6rem;
}

.field-status {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  z-index: 2;
  transform: translateY(-50%);
  padding: 0.16rem 0.38rem;
  border: 1px solid rgba(130, 184, 154, 0.28);
  border-radius: 3px;
  background: rgba(130, 184, 154, 0.1);
  color: #82b89a;
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.optional-field--compact > input {
  padding-left: 0.7rem;
  padding-right: 4.3rem;
}

.optional-field--compact .field-status {
  right: 0.35rem;
  padding-inline: 0.3rem;
  font-size: 0.58rem;
}

.optional-field--textarea .field-status {
  top: 0.75rem;
  transform: none;
}

/* Two-column row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Password field with toggle */
.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 2.8rem;
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0 0.75rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.password-toggle:hover { color: var(--accent); }

/* Password rules */
.password-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.5rem;
}

.rule {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.rule-ok   { color: #27ae60; }
.rule-fail { color: #c0392b; }

/* Forgot password link row */
.form-group--row {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
}

.forgot-link {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.forgot-link:hover { color: var(--accent); }

/* ── Dashboard ──────────────────────────────────────────────── */
.member-dashboard {
  padding-top: calc(var(--nav-height) + 2rem);
  padding-bottom: 5rem;
  flex: 1;
}

.member-dashboard-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* Profile header — aperture-inspired */
.member-profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0 16px 16px 0;
  border-left: 3px solid var(--accent);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Decorative corner lines */
.member-profile-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(200,169,110,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.member-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--accent);
  flex-shrink: 0;
}

.member-profile-info {
  flex: 1;
}

.member-profile-info h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 0.2rem;
}

.member-email-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.member-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: rgba(200,169,110,0.12);
  border: 1px solid var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.member-logout-btn {
  margin-left: auto;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
}

/* Cards — geometric creative grid */
.member-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.member-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 2px 16px 2px 16px;   /* asymmetric corners — like a lens aperture */
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Diagonal accent line across top-right corner */
.member-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, transparent 50%, rgba(200,169,110,0.12) 50%);
  border-radius: 0 16px 0 0;
  transition: width 0.3s, height 0.3s;
}

.member-card:hover {
  transform: translateY(-3px);
  border-color: rgba(200,169,110,0.45);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.member-card:hover::before {
  width: 64px; height: 64px;
}

.member-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 2px 6px rgba(200,169,110,0.25));
}

.member-card h3 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.04em;
}

.member-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.member-card-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: flex-start;
}

.coming-soon {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Profile details — ruled ledger style */
.member-profile-details {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px 2px 16px 2px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.member-profile-details h2 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 2rem;
}

.profile-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.profile-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profile-value {
  font-size: 0.92rem;
  color: var(--white);
}

/* ── Change password modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2.5rem;
}

.modal-box h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .member-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .member-dashboard-inner { padding: 0 1rem; }
  .member-profile-header  { flex-wrap: wrap; border-radius: 0 12px 12px 0; }
  .member-logout-btn      { margin-left: 0; }
  .member-cards           { grid-template-columns: 1fr; }
  .profile-grid           { grid-template-columns: 1fr; }
  .form-row               { grid-template-columns: 1fr; }
  .member-auth-box        { padding: 2rem 1.5rem; }
}

/* ── Additional mobile fixes ────────────────────────────────── */
@media (max-width: 480px) {
  .member-auth-section {
    padding: calc(var(--nav-height) + 1rem) 1rem 2rem;
    align-items: flex-start;
  }

  .member-auth-box {
    padding: 1.5rem 1rem;
    border-radius: 8px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .member-cards { grid-template-columns: 1fr; }

  .member-profile-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .member-logout-btn { width: 100%; }

  .profile-grid { grid-template-columns: 1fr; }

  .modal-box { padding: 1.5rem 1rem; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }

  /* Password rules wrap nicely */
  .password-rules { gap: 0.3rem 0.6rem; }
  .rule           { font-size: 0.7rem; }
}

/* ── member-edit mobile ──────────────────────────────────────── */
@media (max-width: 480px) {
  /* Street + nr grid */
  [style*="grid-template-columns:1fr 90px"] {
    display: grid !important;
    grid-template-columns: 1fr 72px !important;
    gap: 0.6rem !important;
  }

  /* PLZ + city grid */
  [style*="grid-template-columns:100px 1fr"] {
    display: grid !important;
    grid-template-columns: 80px 1fr !important;
    gap: 0.6rem !important;
  }

  /* Breadcrumb on edit page */
  .shared-breadcrumb {
    flex-wrap: wrap;
    font-size: 0.72rem;
  }
}

/* ── Leave membership section ────────────────────────────────── */
.member-leave-section {
  margin-top: 2.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.member-leave-section h2 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.member-leave-section p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.member-leave-btn {
  border-color: #c0392b;
  color: #c0392b;
  font-size: 0.78rem;
}

.member-leave-btn:hover {
  background: #c0392b;
  color: var(--white);
  border-color: #c0392b;
}

/* Leave modal */
.leave-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.leave-modal-box {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2.5rem;
}

.leave-modal-box h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 1rem;
}

.leave-modal-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.leave-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.leave-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition);
  text-align: left;
  width: 100%;
}

.leave-option:hover { border-color: var(--accent); }
.leave-option.selected { border-color: var(--accent); background: rgba(200,169,110,0.08); }

.leave-option-icon { font-size: 1.4rem; flex-shrink: 0; }
.leave-option-text strong { display: block; font-size: 0.85rem; color: var(--white); margin-bottom: 0.2rem; }
.leave-option-text span   { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

.leave-modal-actions { display: flex; gap: 0.75rem; }
.leave-confirm-btn { border-color: #c0392b; color: #c0392b; }
.leave-confirm-btn:hover { background: #c0392b; color: var(--white); }

@media (max-width: 480px) {
  .leave-modal-box { padding: 1.5rem 1rem; }
  .leave-modal-actions { flex-direction: column; }
  .leave-modal-actions .btn { width: 100%; }
}

/* ── Card geometry variants — each card has a different shape ─ */

/* Card 1 — top-right slash (default already defined above) */
.member-card:nth-child(1) { border-radius: 2px 20px 2px 20px; }
.member-card:nth-child(1)::after {
  content: '';
  position: absolute;
  bottom: 1rem; left: 1rem;
  width: 24px; height: 2px;
  background: var(--accent);
  opacity: 0.4;
  border-radius: 1px;
}

/* Card 2 — wide top bar */
.member-card:nth-child(2) {
  border-radius: 16px 2px 16px 2px;
  border-top: 2px solid rgba(200,169,110,0.35);
}

/* Card 3 — diamond slash (all-sharp) */
.member-card:nth-child(3) {
  border-radius: 0 12px 0 12px;
}
.member-card:nth-child(3)::before {
  background: linear-gradient(225deg, transparent 50%, rgba(200,169,110,0.1) 50%);
  border-radius: 0 12px 0 0;
}

/* Card 4 — left accent line */
.member-card:nth-child(4) {
  border-radius: 2px 2px 16px 2px;
  border-left: 2px solid rgba(200,169,110,0.3);
}

/* Card 5 — full round one corner */
.member-card:nth-child(5) {
  border-radius: 24px 2px 2px 2px;
}
.member-card:nth-child(5)::before {
  border-radius: 24px 0 0 0;
  background: linear-gradient(135deg, rgba(200,169,110,0.1) 30%, transparent 70%);
  width: 80px; height: 80px;
  top: 0; left: 0; right: auto;
}

/* Card 6 — bottom accent */
.member-card:nth-child(6) {
  border-radius: 2px 16px 2px 16px;
  border-bottom: 2px solid rgba(200,169,110,0.25);
}

/* Leave section — minimal */
.member-leave-section {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 2px 12px 2px 12px;
  border-left: 2px solid rgba(192,57,43,0.3);
}

/* Areas widget */
.member-areas-widget {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px 2px 12px 2px;
  border-top: 2px solid rgba(200,169,110,0.2);
}

.member-areas-widget h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-areas-widget h2 a {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
