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

  :root {
    --navy:    #1B2A3E;
    --deep:    #131F2E;
    --frost:   #C8D8EC;
    --mist:    #8BA4BF;
    --gold:    #C49A5A;
    --white:   #F0F4F8;
    --green:   #7ABFA0;
    --page-bg: #F4F6F9;
    --card-bg: #FFFFFF;
    --border:  #DDE3EC;
    --label:   #4A5C72;
    --input-bg:#F8FAFC;
    --error:   #C0533A;
    --success: #3A8A6A;
  }

  html { scroll-behavior: smooth; }

  body {
    background: var(--deep);
    color: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 60% 40% at 10% 20%, rgba(46,65,96,0.55) 0%, transparent 65%),
      radial-gradient(ellipse 40% 50% at 90% 70%, rgba(30,50,75,0.35) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
  }

  body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(200,216,236,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(200,216,236,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
  }

  * { position: relative; z-index: 1; }

  nav {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(200,216,236,0.08);
  }

  .logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--frost);
    text-decoration: none;
  }
  .logo em { font-style: italic; color: var(--gold); font-weight: 600; }

  .nav-back {
    font-size: 12px;
    color: var(--mist);
    text-decoration: none;
    transition: color 0.2s;
  }
  .nav-back:hover { color: var(--frost); }

  /* MAIN */
  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 60px;
  }

  /* CARD */
  .auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    animation: fadeUp 0.5s ease both;
  }

  .error-banner,
  .success-banner {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
  }

  .error-banner {
    background: rgba(192, 83, 58, 0.09);
    border: 1px solid rgba(192, 83, 58, 0.25);
    color: #9a3f2d;
  }

  .success-banner {
    background: rgba(58, 138, 106, 0.1);
    border: 1px solid rgba(58, 138, 106, 0.25);
    color: #29654e;
  }

  /* LOGO MARK */
  .card-logo {
    text-align: center;
    margin-bottom: 24px;
  }

  .card-logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
  }
  .card-logo-text em { font-style: italic; color: var(--gold); font-weight: 600; }

  .card-logo-sub {
    font-size: 12px;
    color: var(--mist);
    margin-top: 4px;
    font-weight: 300;
  }

  /* TABS */
  .tabs {
    display: flex;
    background: var(--page-bg);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 28px;
  }

  .tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--mist);
    cursor: pointer;
    transition: all 0.2s;
  }

  .tab.active {
    background: var(--card-bg);
    color: var(--navy);
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(27,42,62,0.1);
  }

  /* FORM */
  .auth-form { display: none; }
  .auth-form.active { display: block; animation: fadeUp 0.3s ease both; }

  .field { margin-bottom: 16px; }
  .field:last-of-type { margin-bottom: 0; }

  label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--label);
    margin-bottom: 7px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: var(--navy);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
  }

  input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(27,42,62,0.07);
    background: #fff;
  }

  input::placeholder { color: rgba(139,164,191,0.5); font-weight: 300; }

  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  /* ACCOUNT TYPE */
  .account-type {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
  }

  .type-option { position: relative; flex: 1; }
  .type-option input { position: absolute; opacity: 0; width: 0; height: 0; }

  .type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    user-select: none;
  }

  .type-label:hover { border-color: var(--navy); }

  .type-option input:checked + .type-label {
    background: rgba(27,42,62,0.05);
    border-color: var(--navy);
  }

  .type-icon { font-size: 20px; }

  .type-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--navy);
  }

  .type-desc {
    font-size: 10px;
    color: var(--mist);
    font-weight: 300;
    line-height: 1.4;
  }

  /* DIVIDER */
  .or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
  }

  .or-line { flex: 1; height: 1px; background: var(--border); }
  .or-text { font-size: 11px; color: var(--mist); font-weight: 300; }

  /* SUBMIT */
  .btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--navy);
    color: var(--frost);
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
  }

  .btn-submit:hover {
    background: var(--deep);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(27,42,62,0.2);
  }

  .forgot {
    text-align: right;
    margin-top: 6px;
  }

  .forgot a {
    font-size: 11px;
    color: var(--mist);
    text-decoration: none;
    transition: color 0.2s;
  }
  .forgot a:hover { color: var(--navy); }

  .form-fine {
    text-align: center;
    font-size: 11px;
    color: rgba(139,164,191,0.5);
    margin-top: 14px;
    line-height: 1.6;
  }

  .form-fine a { color: var(--mist); text-decoration: underline; }

  /* CONTRACTOR NOTE */
  .contractor-note {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(196,154,90,0.07);
    border: 1px solid rgba(196,154,90,0.18);
    border-radius: 8px;
    font-size: 12px;
    color: var(--label);
    line-height: 1.6;
    font-weight: 300;
  }

  .contractor-note a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
  }

  /* SUCCESS SCREEN */
  .success-screen {
    display: none;
    text-align: center;
    animation: fadeUp 0.5s ease both;
  }

  .success-screen.visible { display: block; }
  .auth-card.hidden { display: none; }

  .success-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    text-align: center;
  }

  .success-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(122,191,160,0.12);
    border: 2px solid rgba(122,191,160,0.3);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    font-size: 26px;
  }

  .success-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: -0.8px;
    line-height: 1.1;
    margin-bottom: 10px;
  }

  .success-title em { font-style: italic; font-weight: 400; }

  .success-sub {
    font-size: 14px;
    color: var(--label);
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 28px;
  }

  .success-sub strong { color: var(--navy); font-weight: 500; }

  .contractor-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(122,191,160,0.08);
    border: 1px solid rgba(122,191,160,0.2);
    border-radius: 20px;
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
    margin-bottom: 28px;
  }

  .contractor-count-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 1.5s infinite;
  }

  .what-next {
    text-align: left;
    margin-bottom: 24px;
  }

  .what-next-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mist);
    margin-bottom: 12px;
  }

  .next-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(221,227,236,0.6);
    font-size: 13px;
    color: var(--label);
    font-weight: 300;
    line-height: 1.5;
  }

  .next-item:last-child { border-bottom: none; }

  .next-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
    opacity: 0.7;
    flex-shrink: 0;
    min-width: 16px;
  }

  .btn-portal {
    width: 100%;
    padding: 14px;
    background: var(--navy);
    color: var(--frost);
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
  }

  .btn-portal:hover {
    background: var(--deep);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(27,42,62,0.2);
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
  }
