/* ==========================================================================
   Customer Portal: login page
   Requires portal.css. Mobile-first; split layout from 900px
   ========================================================================== */

   .layout {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  /* ---------- Brand panel ---------- */
  
  .brand {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    color: var(--color-white);
    background: var(--color-primary);
    text-align: center;
    border-bottom: 4px solid var(--color-secondary-dark);
  }
  
  .brand__logo {
    display: inline-block;
    border-radius: 2px;
  }
  
  .brand__logo:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 4px;
  }
  
  .brand__copy { margin-top: 0.75rem; }
  
  .brand__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
  }
  
  /* Hidden on mobile to keep the form above the fold */
  .brand__text {
    display: none;
    max-width: 28rem;
    margin: 1rem 0 0;
    font-size: 1.125rem;
    color: rgb(255 255 255 / 0.85);
  }
  
  /* ---------- Sign-in panel ---------- */
  
  .auth {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem 1.25rem 2.5rem;
  }
  
  .auth__inner {
    width: 100%;
    max-width: 25rem;
  }
  
  .auth__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
  }
  
  .auth__subtitle {
    margin: 0.5rem 0 1.5rem;
    color: var(--color-gray-dark);
  }
  
  /* ---------- Error banner ---------- */
  
  .alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.875rem 1rem;
    background: var(--color-error-bg);
    border: 1px solid var(--color-error);
    border-left-width: 4px;
    border-radius: var(--radius);
  }
  
  .alert__icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    color: var(--color-error);
  }
  
  .alert__text {
    margin: 0;
    font-size: 0.9375rem;
  }
  
  /* ---------- Form ---------- */
  
  .form {
    display: grid;
    gap: 1.25rem;
  }
  
  .form .button { margin-top: 0.5rem; }
  
  .field {
    display: grid;
    gap: 0.375rem;
  }
  
  .field label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-gray-dark);
  }
  
  .field__meta {
    font-weight: 400;
    color: var(--color-gray-light);
  }
  
  .field input {
    width: 100%;
    height: var(--control-height);
    padding: 0 0.875rem;
    font: inherit;
    font-size: 1rem; /* 16px minimum stops iOS zooming on focus */
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  
  .field input:hover { border-color: var(--color-gray-dark); }
  
  .field input:focus {
    /* Transparent outline keeps a focus indicator in Windows high-contrast mode */
    outline: 2px solid transparent;
    border-color: var(--color-highlight);
    box-shadow: var(--focus-ring);
  }
  
  /* Even digit widths and a little spacing make codes easier to check */
  .input--code {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.15em;
  }
  
  .field.is-invalid input { border-color: var(--color-error); }
  
  .field.is-invalid input:focus { box-shadow: 0 0 0 3px rgb(179 38 30 / 0.25); }
  
  .field__error {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-error);
  }
  
  /* ---------- Desktop: split layout ---------- */
  
  @media (min-width: 900px) {
    .layout { flex-direction: row; }
  
    .brand {
      text-align: left;
      flex: 0 0 42%;
      display: flex;
      flex-direction: column;
      padding: 3rem;
      border-bottom: 0;
      border-right: 4px solid var(--color-secondary-dark);
    }
  
    /* Decorative rings in the secondary blues */
    .brand::before,
    .brand::after {
      content: "";
      position: absolute;
      border-radius: 50%;
      pointer-events: none;
    }
  
    .brand::before {
      width: 28rem;
      height: 28rem;
      right: -10rem;
      bottom: -10rem;
      border: 3rem solid var(--color-secondary);
    }
  
    .brand::after {
      width: 16rem;
      height: 16rem;
      right: -5rem;
      bottom: -5rem;
      border: 2rem solid var(--color-secondary-dark);
    }
  
    .brand > * {
      position: relative;
      z-index: 1;
    }
  
    .brand__copy { margin: auto 0; }  /* vertically centred */
  
    .brand__title {
      font-size: 2.25rem;
      line-height: 1.2;
    }
  
    .brand__text { display: block; }
  
    .auth {
      align-items: center;
      padding: 3rem;
    }
  }
  
  @media (forced-colors: active) {
    .brand::before,
    .brand::after { display: none; }
  }