/* ClionCare auth — modern shadcn-style design system.
   Shared by login / forgot-password / reset-password / reset-send.
   Self-contained (no Tailwind dependency) so the auth screens render crisply
   and independently of the app shell. */
:root {
  --cc-red: #E23744;
  --cc-red-600: #E6222B;
  --cc-red-700: #BE2E39;
  --cc-red-900: #5F171D;
  --cc-red-50: #FEF2F3;
  --cc-red-100: #FDE7E9;
  --cc-ink: #0f172a;
  --cc-muted: #64748b;
  --cc-line: #e2e8f0;
  --cc-bg: #f8fafc;
  --cc-white: #ffffff;
  --cc-radius: 16px;
  --cc-shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 40px -12px rgba(15,23,42,.18);
  --cc-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--cc-font); background: var(--cc-bg); color: var(--cc-ink); -webkit-font-smoothing: antialiased; }

/* ── Split layout ────────────────────────────────────────── */
.cc-auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}
@media (max-width: 900px) {
  .cc-auth { grid-template-columns: 1fr; }
}

/* Left branded panel */
.cc-auth__panel {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(24px, 4vw, 56px);
  background: radial-gradient(120% 120% at 0% 0%, #2a0a0e 0%, #5F171D 40%, #95242D 100%), var(--cc-red-900);
  color: #fff;
}
@media (max-width: 900px) {
  .cc-auth__panel { min-height: 40dvh; padding: 24px 22px; }
}
.cc-auth__panel::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.10), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,.06), transparent 45%);
}
.cc-auth__panel > * { position: relative; z-index: 1; }
.cc-auth__brand { display: flex; align-items: center; gap: 12px; }
.cc-auth__brand img { height: 44px; width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3)); }
.cc-auth__brand span { font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.cc-auth__tagline { margin-top: 0; font-size: clamp(26px, 4.5vw, 46px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; max-width: 15ch; }
.cc-auth__points { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.cc-auth__point { display: flex; align-items: center; gap: 12px; font-size: 15px; opacity: .96; }
.cc-auth__point .dot { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: 0 0 auto; }
.cc-auth__foot { font-size: 13px; opacity: .7; }
@media (max-width: 900px) {
  .cc-auth__tagline { font-size: 26px; }
  .cc-auth__points { margin-top: 18px; }
  .cc-auth__point { font-size: 14px; }
}

/* Right form area */
.cc-auth__formwrap { display: grid; place-items: center; padding: clamp(20px, 5vw, 64px); }
.cc-auth__card {
  width: 100%; max-width: 420px;
  background: var(--cc-white);
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: clamp(28px, 4vw, 40px);
}
.cc-auth__card h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.cc-auth__card .sub { margin: 0 0 24px; color: var(--cc-muted); font-size: 14px; line-height: 1.5; }

/* Fields */
.cc-field { margin-bottom: 16px; }
.cc-field label { display: block; font-size: 13px; font-weight: 500; color: var(--cc-ink); margin-bottom: 7px; }
.cc-input {
  width: 100%; height: 46px;
  padding: 0 14px;
  border: 1px solid var(--cc-line); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--cc-ink);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.cc-input::placeholder { color: #94a3b8; }
.cc-input:focus { outline: none; border-color: var(--cc-red-600); box-shadow: 0 0 0 3px rgba(237,28,36,.12); }
.cc-pw { position: relative; }
.cc-pw .cc-input { padding-right: 42px; }
.cc-pw__toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--cc-muted); padding: 6px; display: grid; place-items: center; }
.cc-pw__toggle:hover { color: var(--cc-ink); }
.cc-pw__toggle .hide { display: none; }

/* Button */
.cc-btn-primary {
  width: 100%; height: 48px;
  border: 0; border-radius: 10px;
  background: linear-gradient(180deg, var(--cc-red-600), var(--cc-red));
  color: #fff; font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform .06s, filter .15s, box-shadow .15s;
  box-shadow: 0 8px 20px -8px rgba(237,28,36,.55);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cc-btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 24px -8px rgba(237,28,36,.6); }
.cc-btn-primary:active { transform: translateY(1px); }

/* Links / secondary row */
.cc-auth__row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.cc-link { color: var(--cc-red-600); font-size: 13px; font-weight: 500; text-decoration: none; }
.cc-link:hover { text-decoration: underline; }
.cc-auth__footlink { text-align: center; margin-top: 22px; font-size: 14px; color: var(--cc-muted); }
.cc-auth__footlink a { color: var(--cc-red-600); font-weight: 600; text-decoration: none; }
.cc-auth__footlink a:hover { text-decoration: underline; }

/* Alerts (stacked under card) */
.cc-alert-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(440px, 92vw); display: flex; flex-direction: column; gap: 8px; }
.cc-alert { font-size: 13px; padding: 12px 14px; border-radius: 10px; box-shadow: var(--cc-shadow); }
.cc-alert--danger, .cc-alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.cc-alert--success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.cc-alert--warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.cc-alert--info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Mobile nav (back link) on the form side */
.cc-auth__top { display: flex; justify-content: flex-end; margin-bottom: 8px; }

@media (max-width: 900px) {
  .cc-auth__card h1 { font-size: 22px; }
}

/* ============================================================
   MOBILE-FIRST POLISH — iOS/Android-friendly, safe-area aware.
   ============================================================ */

/* 1) Prevent horizontal overflow at any width */
html, body { overflow-x: hidden; width: 100%; }

/* 2) iOS "tap-to-focus auto-zoom" prevention:
      inputs < 16px force Safari to zoom in. Keep inputs 16px+ on touch. */
@media (max-width: 900px) {
  .cc-input, input.cc-input {
    font-size: 16px !important;   /* stops iOS auto-zoom */
    height: 52px;                 /* easier to tap */
  }
  .cc-btn-primary { height: 52px; font-size: 16px; }
}

/* 3) Safe-area insets (notched phones / PWA in standalone mode) */
.cc-auth {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.cc-auth__panel { padding: calc(clamp(24px, 4vw, 56px) + env(safe-area-inset-top)) clamp(22px, 4vw, 56px) calc(16px + env(safe-area-inset-bottom)); }

/* 4) Better mobile layout */
@media (max-width: 900px) {
  .cc-auth { display: flex; flex-direction: column; min-height: 100dvh; }
  /* Compact brand banner, not a tall panel */
  .cc-auth__panel {
    min-height: auto;
    padding: calc(20px + env(safe-area-inset-top)) 20px 18px;
    border-radius: 0 0 22px 22px;
  }
  .cc-auth__brand img { height: 34px; }
  .cc-auth__brand span { font-size: 17px; }
  .cc-auth__tagline { font-size: 20px; max-width: none; margin-top: 8px; }
  .cc-auth__points { display: none; }        /* hide bullet list on phones = cleaner, less scrolling */
  .cc-auth__foot { display: none; }          /* copyright moves into form footer */

  /* Form card fills the rest, centered, not cramped */
  .cc-auth__formwrap {
    display: flex; flex-direction: column; justify-content: center;
    padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
    flex: 1;
  }
  .cc-auth__card {
    max-width: 100%;
    padding: 24px 20px;
    border-radius: 18px;
    box-shadow: 0 8px 32px -8px rgba(15,23,42,.22);
  }
  .cc-auth__card h1 { font-size: 21px; }
  .cc-auth__card .sub { font-size: 14px; margin-bottom: 18px; }

  /* Bigger, comfortable tap targets */
  .cc-field { margin-bottom: 14px; }
  .cc-field label { font-size: 13px; }
  .cc-pw__toggle { padding: 10px; right: 6px; }         /* bigger hit area */
  .cc-pw .cc-input { padding-right: 46px; }
  .cc-link, .cc-auth__footlink { font-size: 14px; }

  /* Alerts sit inside safe area */
  .cc-alert-container { top: calc(12px + env(safe-area-inset-top)); width: 92vw; }

  /* Landscape / very short phones: let it scroll rather than squeeze */
  @media (max-height: 600px) {
    .cc-auth { min-height: auto; }
    .cc-auth__formwrap { justify-content: flex-start; padding-top: 16px; }
  }
}

/* 5) Very narrow screens (<360px) */
@media (max-width: 360px) {
  .cc-auth__panel { padding: 16px 16px 14px; }
  .cc-auth__card { padding: 20px 16px; }
  .cc-auth__row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cc-auth__footlink { margin-top: 16px; }
}
