/*
File: assets/css/admin/admin-login.css
Purpose: Individual admin login UI without a registration call-to-action
*/
/* Admin Login Variables Start */

/*
Responsive Contract:
- Base: 0px–479px
- Large Mobile: min-width 480px
- Tablet: min-width 768px
- Laptop / Small Desktop: min-width 1024px
- Desktop: min-width 1280px
- Wide Desktop: min-width 1440px
- Print stays isolated from device breakpoints.
*/

@layer rm_admin_admin_login {
  @layer foundation, responsive, print;

  @layer foundation {
    :root {
      --admin-theme: #d50d30;
      --admin-theme-dark: #b50c28;
      --admin-ink: #492026;
      --admin-muted: #7b6267;
      --admin-line: #eedadd;
      --admin-soft: #fff6f7;
    }

    * {
      box-sizing: border-box;
    }

    html {
      min-width: 320px;
    }

    body {
      margin: 0;
      color: var(--admin-ink);
      font-family: Arial, Helvetica, sans-serif;
    }

    button,
    input {
      font: inherit;
    }

    a {
      color: inherit;
    }

    .login-page {
      min-height: 100vh;
      min-height: 100dvh;
      background:
        radial-gradient(
          circle at 14% 10%,
          rgba(213, 13, 48, 0.08),
          transparent 35%
        ),
        radial-gradient(
          circle at 88% 88%,
          rgba(9, 6, 116, 0.06),
          transparent 28%
        ),
        #f6f8fc;
    }

    .login-wrapper {
      min-height: 100vh;
      min-height: 100dvh;
      /* Compact outer spacing: preserves safe scroll on short laptop/mobile screens. */
      padding: 24px 20px;
      display: grid;
      place-items: center;
    }

    .login-card {
      width: min(100%, 540px);
      /* Compact top space without changing approved card, font or input design. */
      padding: 26px 40px 28px;
      border: 1px solid #d8e0ec;
      border-top: 4px solid var(--admin-theme);
      border-radius: 20px;
      background: #ffffff;
      box-shadow: 0 24px 54px rgba(34, 48, 79, 0.12);
    }

    .login-brand {
      width: min(100%, 274px);
      margin: 0 auto 16px;
    }

    .login-brand img {
      width: 100%;
      height: auto;
      display: block;
      object-fit: contain;
    }

    .login-role {
      margin: 0 0 14px;
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 14px;
    }

    .login-role > span {
      height: 1px;
      background: #f2dfe2;
    }

    .login-role b {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: #fff0f3;
      color: var(--admin-theme);
      font-size: 19px;
    }

    .login-card-heading {
      margin-bottom: 27px;
      text-align: center;
    }

    .login-card-heading h1 {
      margin: 0 0 8px;
      color: var(--admin-theme-dark);
      font-size: clamp(28px, 4.5vw, 34px);
      line-height: 1.15;
    }

    .login-card-heading p {
      margin: 0;
      color: var(--admin-muted);
      font-size: 14px;
      line-height: 1.6;
    }

    .form-group {
      margin-bottom: 8px;
    }

    .form-group label {
      margin-bottom: 8px;
      display: block;
      color: #5b262f;
      font-size: 13px;
      font-weight: 700;
    }

    .input-with-icon {
      min-height: 54px;
      display: flex;
      align-items: center;
      position: relative;
      border: 1px solid #e0cbd0;
      border-radius: 10px;
      background: #ffffff;
      transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    }

    .input-with-icon:focus-within {
      border-color: var(--admin-theme);
      box-shadow: 0 0 0 3px rgba(213, 13, 48, 0.1);
    }

    .input-icon {
      width: 44px;
      height: 38px;
      margin-left: 7px;
      display: grid;
      place-items: center;
      flex: 0 0 44px;
      border-radius: 9px;
      background: #fff1f3;
      color: var(--admin-theme);
      font-size: 15px;
    }

    .input-with-icon input {
      width: 100%;
      min-width: 0;
      height: 52px;
      padding: 0 14px;
      border: 0;
      outline: 0;
      background: transparent;
      color: var(--admin-ink);
      font-size: 14px;
    }

    .input-with-icon input::placeholder {
      color: #94a3b8;
    }

    .password-input-wrap input {
      padding-right: 50px;
    }

    .password-toggle {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      position: absolute;
      right: 5px;
      border: 0;
      border-radius: 9px;
      background: transparent;
      color: #64748b;
      cursor: pointer;
    }

    .password-toggle:hover {
      color: var(--admin-theme);
      background: #fff3f5;
    }

    .field-error {
      min-height: 15px;
      margin-top: 5px;
      display: block;
      color: #c81e3f;
      font-size: 12px;
    }

    .login-options {
      margin: 2px 0 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .remember-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: #73545a;
      font-size: 13px;
      cursor: pointer;
    }

    .remember-label input {
      width: 16px;
      height: 16px;
      accent-color: var(--admin-theme);
    }

    .forgot-password-link {
      color: var(--admin-theme);
      font-size: 13px;
      font-weight: 700;
      text-decoration: none;
    }

    .forgot-password-link:hover {
      text-decoration: underline;
    }

    .login-button {
      width: 100%;
      min-height: 54px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 11px;
      border: 0;
      border-radius: 10px;
      background: linear-gradient(
        110deg,
        var(--admin-theme-dark),
        var(--admin-theme)
      );
      color: #ffffff;
      cursor: pointer;
      font-size: 14px;
      font-weight: 700;
      transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    }

    .login-button:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 22px rgba(213, 13, 48, 0.22);
    }

    .login-button:active {
      transform: translateY(0);
    }

    .login-message {
      display: none;
      margin-bottom: 16px;
      padding: 11px 12px;
      border-radius: 9px;
      font-size: 12px;
      line-height: 1.5;
    }

    .login-message.error {
      display: block;
      border: 1px solid #fecaca;
      background: #fff1f2;
      color: #be123c;
    }

    .login-message.success {
      display: block;
      border: 1px solid #bbf7d0;
      background: #f0fdf4;
      color: #15803d;
    }

    .login-card-footer {
      margin-top: 25px;
      padding: 14px 15px;
      display: flex;
      align-items: flex-start;
      gap: 9px;
      border: 1px solid #f3dadd;
      border-radius: 10px;
      background: #fff3f4;
      color: #7b5b62;
      font-size: 12px;
      line-height: 1.5;
    }

    .login-card-footer i {
      margin-top: 1px;
      color: var(--admin-theme);
    }

    .admin-password-help-heading {
      margin-bottom: 22px;
    }

    .admin-password-help-note-field textarea {
      width: 100%;
      min-height: 86px;
      padding: 12px 14px;
      resize: vertical;
      border: 1px solid #e0cbd0;
      border-radius: 10px;
      outline: 0;
      color: var(--admin-ink);
      font: inherit;
      font-size: 14px;
      line-height: 1.45;
    }

    .admin-password-help-note-field textarea:focus {
      border-color: var(--admin-theme);
      box-shadow: 0 0 0 3px rgba(213, 13, 48, 0.1);
    }

    .admin-password-help-note-field label span {
      color: var(--admin-muted);
      font-weight: 400;
    }

    .admin-login-return-link {
      margin-top: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      color: var(--admin-theme);
      font-size: 13px;
      font-weight: 700;
      text-decoration: none;
    }

    .admin-login-return-link:hover {
      text-decoration: underline;
    }
  }

  @layer responsive {
    /* Base: Small Mobile (0px–479px) */
    .login-wrapper {
      padding: 16px 12px;
    }
    .login-card {
      padding: 20px 10px;
      border-radius: 17px;
    }
    .login-brand {
      width: min(100%, 150px);
    }

    .login-options {
      align-items: flex-start;
      flex-wrap: nowrap;
      justify-content: space-between;
      gap: 10px;
    }
    .login-card-heading h1 {
      font-size: 27px;
    }

    /* Large Mobile (480px and above) */
    @media (min-width: 480px) {
      .login-options {
        align-items: revert-layer;
        flex-direction: revert-layer;
        gap: revert-layer;
      }

      .login-card-heading h1 {
        font-size: revert-layer;
      }

      .login-wrapper {
        padding: 16px 12px;
      }
      .login-card {
        padding: 24px 21px 24px;
        border-radius: 17px;
      }
      .login-brand {
        width: min(100%, 245px);
      }
    }

    /* Tablet (768px and above) */
    @media (min-width: 768px) {
      .login-wrapper {
        padding: revert-layer;
      }

      .login-card {
        border-radius: revert-layer;
        padding: revert-layer;
      }

      .login-brand {
        width: revert-layer;
      }
    }
  }
}

/* Short-height phones keep the same natural design with tighter spacing. */
@media (max-width: 479px) and (max-height: 640px) {
  .login-wrapper {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .login-card {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .login-brand {
    width: min(100%, 140px);
    margin-bottom: 10px;
  }

  .login-role {
    margin-bottom: 8px;
  }

  .login-role b {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  .login-card-heading {
    margin-bottom: 14px;
  }

  .login-card-heading h1 {
    margin-bottom: 4px;
    font-size: 25px;
  }

  .login-card-heading p {
    font-size: 12px;
    line-height: 1.35;
  }

  .form-group {
    margin-bottom: 5px;
  }

  .form-group label {
    margin-bottom: 5px;
  }

  .input-with-icon {
    min-height: 50px;
  }

  .input-with-icon input {
    height: 48px;
  }

  .field-error {
    min-height: 10px;
    margin-top: 2px;
    font-size: 10.5px;
  }

  .login-options {
    margin-bottom: 12px;
  }

  .login-button {
    min-height: 50px;
  }

  .login-message {
    margin-bottom: 8px;
    padding: 7px 9px;
    line-height: 1.3;
  }
}
