/* YachtClub Tenant Login
 * Full-bleed branded login page with glass form card.
 * Shares design tokens with yachtclub_email.css (Plus Jakarta Sans, brand palette).
 *
 * Structure:
 *   1. Tenant theme tokens (overridable per-company)
 *   2. Platform tokens (shared)
 *   3. Base reset
 *   4. Login shell (background, scrim, decorative elements)
 *   5. Brand content (wordmark)
 *   6. Form card (glass card, fields, CTA)
 *   7. Responsive
 */

/* ==========================================================================
   1. Tenant theme — set per-company via SaaS admin (future)
   ========================================================================== */

:root {
  --tenant-primary:           #5D87FF;
  --tenant-primary-hover:     #4a76f0;
  --tenant-on-primary:        #ffffff;
  --tenant-brand-fg:          #ffffff;
  --tenant-brand-fg-muted:    rgba(255, 255, 255, 0.72);
  --tenant-brand-fg-quiet:    rgba(255, 255, 255, 0.45);
  --tenant-scrim:             rgba(15, 22, 38, 0.55);
}

/* ==========================================================================
   2. Platform tokens
   ========================================================================== */

:root {
  --tyc-text:                 #2A3547;
  --tyc-muted:                #7C8FAC;
  --tyc-light:                #a8b4c3;
  --tyc-border:               #e5eaef;
  --tyc-bg:                   #F2F6FA;
  --tyc-platform-blue:        #5D87FF;
  --tyc-platform-cyan:        #49BEFF;
  --tyc-success:              #6cd9b0;
}

/* ==========================================================================
   3. Base reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--tyc-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--tyc-bg);
}

/* ==========================================================================
   4. Navbar — blank placeholder
   ========================================================================== */

.login-navbar {
  background: #2A3547;
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ==========================================================================
   5. Login shell — centered card on light canvas
   ========================================================================== */

.login-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--tyc-bg);
}

/* Decorative waves at bottom */
.brand-waves {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%; height: 220px;
  z-index: 1;
  opacity: 0.4;
  pointer-events: none;
}

/* Compass watermark */
.brand-compass {
  position: absolute;
  top: 50%; right: -260px;
  transform: translateY(-50%);
  width: 760px; height: 760px;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
  color: var(--tyc-text);
}

/* ==========================================================================
   5. Form card — glass card with header band
   ========================================================================== */

.form-card {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 480px;
  max-width: calc(100% - 32px);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Header band — matches the statement email header */
.form-header-band {
  background-color: #2A3547;
  padding: 18px 32px;
}
.form-header-wordmark {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Hero strip — yacht club avatar photo */
.form-header-hero {
  line-height: 0;
  overflow: hidden;
  max-height: 110px;
}
.form-header-hero img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.form-card-body {
  padding: 36px 36px 28px;
}

/* Platform attribution — below the card */
.platform-attribution {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-top: 20px;
}
.platform-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--tyc-light);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.platform-mark:hover { color: var(--tyc-muted); }
.platform-mark .pm-glyph {
  width: 16px; height: 16px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--tyc-platform-blue), var(--tyc-platform-cyan));
  flex-shrink: 0;
}
.platform-mark strong { font-weight: 700; color: inherit; }

/* Card headings */
.form-eyebrow {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--tyc-muted);
  margin: 0 0 6px;
}
.form-title {
  font-size: 26px; font-weight: 800;
  color: var(--tyc-text);
  letter-spacing: -0.02em; line-height: 1.15;
  margin: 0 0 6px;
}
.form-subtitle {
  font-size: 13.5px; line-height: 1.55;
  color: var(--tyc-muted);
  margin: 0 0 26px;
}

/* Field group */
.field { margin-bottom: 16px; }
.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}
.field-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #5A6A85;
}
.field-link {
  font-size: 11.5px; font-weight: 600;
  color: var(--tenant-primary);
  text-decoration: none;
}
.field-link:hover { text-decoration: underline; }

.input-wrap { position: relative; }

.field-input {
  width: 100%; height: 46px;
  padding: 0 14px;
  font-family: inherit; font-size: 15px; line-height: 46px;
  color: var(--tyc-text);
  background: #ffffff;
  border: 1px solid var(--tyc-border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.field-input::placeholder { color: var(--tyc-light); }
.field-input:hover { border-color: #d0d7e2; }
.field-input:focus {
  outline: none;
  border-color: var(--tenant-primary);
  box-shadow: 0 0 0 3px rgba(93, 135, 255, 0.18);
}
.field-input.has-toggle { padding-right: 46px; }

.input-toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border: 0; background: transparent;
  color: var(--tyc-muted); font-size: 16px;
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.input-toggle:hover { background: var(--tyc-bg); color: var(--tyc-text); }

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 22px;
  cursor: pointer; user-select: none;
}
.field-check input {
  width: 16px; height: 16px;
  margin: 0; cursor: pointer;
  accent-color: var(--tenant-primary);
}
.field-check span { font-size: 13px; color: var(--tyc-text); }

/* CTA button */
.btn-submit {
  width: 100%; height: 50px;
  padding: 0 24px;
  background: var(--tenant-primary);
  color: var(--tenant-on-primary);
  border: 0; border-radius: 8px;
  font-family: inherit; font-size: 15.5px; font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  box-shadow: 0 4px 12px rgba(93, 135, 255, 0.32);
}
.btn-submit:hover { background: var(--tenant-primary-hover); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:focus-visible { outline: 3px solid rgba(93, 135, 255, 0.4); outline-offset: 2px; }

/* Apply / sign-up row */
.apply-row {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--tyc-muted);
}
.apply-row a {
  color: var(--tenant-primary);
  font-weight: 700; text-decoration: none;
  margin-left: 4px;
}
.apply-row a:hover { text-decoration: underline; }
.apply-row a .bi { font-size: 11px; vertical-align: -1px; margin-left: 2px; }

/* Footer — legal + copyright */
.form-bottom {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--tyc-border);
  text-align: center;
  font-size: 11px; color: var(--tyc-light); line-height: 1.65;
}
.form-bottom a { color: var(--tyc-muted); text-decoration: none; margin: 0 6px; }
.form-bottom a:hover { color: var(--tyc-text); }
.form-bottom .copy { display: block; margin-top: 4px; }

/* Wide card variant — apply form */
.form-card-wide { width: 620px; }

/* Field grid — two-column rows */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.field-grid-3 {
  grid-template-columns: 2fr 1fr 1fr;
}

/* Select inputs */
.field-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237C8FAC' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Textarea */
.field-textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.55;
  resize: vertical;
}

/* Flash alerts */
.tenant-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.tenant-alert-success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

/* ==========================================================================
   7. Responsive
   ========================================================================== */

@media (max-width: 600px) {
  .field-grid, .field-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .login-shell { padding: 24px 16px; }
  .form-card {
    position: static;
    transform: none;
    width: auto;
    align-self: stretch;
  }
  .form-card-body { padding: 24px 20px 20px; }
  .form-header-band { padding: 14px 20px; }
  .form-title { font-size: 22px; }
  .brand-compass { display: none; }
}
