:root {
      --primary: #0055cc;
      --primary-dark: #003399;
      --text: #003366;
      --bg: #A1A1A1;
      --card: #ffffff;
      --border: #d7d7d7;
      --danger: #b00020;
      --success: #0a7a2f;
      --muted: #52606d;
      --shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
      --radius: 16px;
    }

    * { box-sizing: border-box; }

    html,
    body { min-height: 100%; }

    body.login-page {
      margin: 0;
      min-height: 100dvh;
      background:
        linear-gradient(rgba(0, 51, 102, 0.18), rgba(0, 51, 102, 0.18)),
        var(--bg);
      color: var(--text);
      font-family: Arial, Helvetica, sans-serif;
      display: flex;
      flex-direction: column;
    }

    .login-main {
      flex: 1;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 28px 16px;
    }

    .login-wrapper { width: min(440px, 100%); }

    .login-card {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .login-header {
      background: var(--primary);
      color: #fff;
      text-align: center;
      padding: 26px 20px;
    }

    .login-header img {
      width: min(120px, 45%);
      height: auto;
      display: block;
      margin: 0 auto 14px;
    }

    .login-header h1 {
      margin: 0;
      font-size: clamp(1.35rem, 5vw, 2rem);
      line-height: 1.2;
    }

    .login-header p {
      margin: 8px 0 0;
      opacity: 0.95;
      font-weight: bold;
    }

    .login-body { padding: 24px; }

    .msg-error,
    .msg-success {
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 16px;
      font-weight: bold;
      text-align: center;
      line-height: 1.35;
    }

    .msg-error {
      background: #fff3f3;
      color: var(--danger);
      border: 1px solid #ffd1d1;
    }

    .msg-success {
      background: #e6ffe6;
      color: var(--success);
      border: 1px solid #8fd19e;
    }

    .form-field { margin-bottom: 16px; }

    label {
      display: block;
      font-weight: bold;
      margin-bottom: 7px;
    }

    input {
      width: 100%;
      min-height: 46px;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 1rem;
      color: #111;
      background: #fff;
    }

    input:focus {
      outline: 3px solid rgba(0, 85, 204, 0.18);
      border-color: var(--primary);
    }

    .password-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .password-wrapper input { padding-right: 54px; }

    .password-toggle {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      width: 38px;
      min-width: 38px;
      height: 34px;
      min-height: 34px;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #f7faff;
      color: var(--text);
      font-size: 1.05rem;
      line-height: 1;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    small {
      color: var(--muted);
      line-height: 1.35;
    }

    .button-stack {
      display: grid;
      gap: 12px;
      margin-top: 20px;
    }

    button,
    .btn {
      width: 100%;
      min-height: 46px;
      border: none;
      border-radius: 10px;
      padding: 11px 16px;
      background: var(--primary);
      color: #fff;
      font-size: 1rem;
      font-weight: bold;
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    button:hover,
    .btn:hover {
      background: var(--primary-dark);
      text-decoration: none;
    }

    .btn-secondary {
      background: #ffffff;
      color: var(--text);
      border: 1px solid var(--border);
    }

    .btn-secondary:hover {
      background: #eef4ff;
      color: var(--text);
    }

    .login-footer {
      text-align: center;
      padding: 14px 20px 22px;
      font-size: 0.9rem;
      color: var(--muted);
      line-height: 1.35;
    }

    .login-switch {
      margin-top: 18px;
      text-align: center;
    }

    .login-switch a {
      color: var(--primary);
      font-weight: bold;
      text-decoration: none;
    }

    .login-switch a:hover {
      color: var(--primary-dark);
      text-decoration: underline;
    }

    @media (max-width: 480px) {
      .login-main {
        padding: 18px 14px;
      }

      .login-body {
        padding: 18px;
      }

      .login-header {
        padding: 22px 16px;
      }

      .login-header img {
        width: min(96px, 42%);
      }
    }
