/* =========================================================
   Login Page Variables
   ========================================================= */

:root {
  --login-background: #f4f7fb;
  --login-surface: #ffffff;
  --login-surface-soft: #f8fafc;

  --login-border: #dfe6ee;
  --login-border-dark: #cbd5e1;

  --login-heading: #0f172a;
  --login-text: #172033;
  --login-text-soft: #64748b;

  --login-primary: #234f7d;
  --login-primary-dark: #183b60;
  --login-primary-soft: #eaf1f8;

  --login-error: #c62828;
  --login-error-background: #fff1f1;

  --login-success: #237a3b;
  --login-success-background: #edf8f0;

  --login-radius: 16px;
  --login-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}


/* =========================================================
   Global Reset
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--login-text);
  background:
    radial-gradient(
      circle at top left,
      rgba(35, 79, 125, 0.12),
      transparent 35%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(35, 79, 125, 0.08),
      transparent 30%
    ),
    var(--login-background);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}


/* =========================================================
   Page Layout
   ========================================================= */

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px 20px;
}

.login-panel {
  width: min(100%, 460px);
  padding: 38px;
  background: var(--login-surface);
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius);
  box-shadow: var(--login-shadow);
}


/* =========================================================
   Branding and Header
   ========================================================= */

.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--login-primary);
  background: var(--login-primary-soft);
  border: 1px solid rgba(35, 79, 125, 0.12);
  border-radius: 13px;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.brand-eyebrow {
  margin: 1px 0 5px;
  color: var(--login-primary);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-brand h1 {
  margin: 0;
  color: var(--login-heading);
  font-size: 2rem;
  line-height: 1.15;
}

.login-subtitle {
  margin: 9px 0 0;
  color: var(--login-text-soft);
  font-size: 0.94rem;
  line-height: 1.55;
}


/* =========================================================
   Form Fields
   ========================================================= */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field label {
  color: var(--login-heading);
  font-size: 0.87rem;
  font-weight: 750;
}

.form-field input {
  display: block;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 13px;
  color: var(--login-text);
  background: #ffffff;
  border: 1px solid var(--login-border-dark);
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.form-field input::placeholder {
  color: #9aa6b5;
}

.form-field input:hover {
  border-color: #aebaca;
}

.form-field input:focus {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px rgba(35, 79, 125, 0.14);
}


/* =========================================================
   Buttons
   ========================================================= */

.sign-in-button,
.reset-password-button {
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 18px;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.sign-in-button {
  margin-top: 2px;
  color: #ffffff;
  background: var(--login-primary);
  border: 1px solid var(--login-primary);
}

.sign-in-button:hover {
  background: var(--login-primary-dark);
  border-color: var(--login-primary-dark);
  box-shadow: 0 7px 17px rgba(24, 59, 96, 0.22);
  transform: translateY(-1px);
}

.sign-in-button:active {
  box-shadow: none;
  transform: translateY(0);
}

.reset-password-button {
  color: var(--login-primary);
  background: var(--login-primary-soft);
  border: 1px solid rgba(35, 79, 125, 0.18);
}

.reset-password-button:hover {
  color: #ffffff;
  background: var(--login-primary);
  border-color: var(--login-primary);
  transform: translateY(-1px);
}

.reset-password-button:disabled {
  color: var(--login-text-soft);
  background: #eef2f6;
  border-color: var(--login-border);
  cursor: not-allowed;
  opacity: 0.8;
  transform: none;
}


/* =========================================================
   Divider
   ========================================================= */

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--login-text-soft);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
}

.form-divider::before,
.form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--login-border);
}

.form-divider span {
  white-space: nowrap;
}


/* =========================================================
   Form Messages
   ========================================================= */

.form-message {
  display: none;
  margin: -5px 0 0;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.45;
}

.form-message:not(:empty) {
  display: block;
}

.error-message,
.reset-message.message-error {
  color: var(--login-error);
  background: var(--login-error-background);
  border: 1px solid rgba(198, 40, 40, 0.18);
}

.reset-message:not(:empty):not(.message-error) {
  color: var(--login-success);
  background: var(--login-success-background);
  border: 1px solid rgba(35, 122, 59, 0.18);
}


/* =========================================================
   Footer
   ========================================================= */

.login-footer {
  margin: 18px 0 0;
  color: var(--login-text-soft);
  font-size: 0.79rem;
  font-weight: 650;
}


/* =========================================================
   Responsive Layout
   ========================================================= */

@media (max-width: 560px) {
  .login-page {
    justify-content: flex-start;
    padding: 24px 14px;
  }

  .login-panel {
    padding: 27px 22px;
    border-radius: 13px;
  }

  .login-brand {
    gap: 13px;
    margin-bottom: 25px;
  }

  .brand-mark {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .login-brand h1 {
    font-size: 1.7rem;
  }
}

@media (max-width: 390px) {
  .login-brand {
    flex-direction: column;
  }

  .form-divider span {
    white-space: normal;
  }
}

/* =========================================================
   Pipeline Powerhouse Logo
   ========================================================= */

.brand-logo-container {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(35, 79, 125, 0.14);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  padding: 7px;
  object-fit: contain;
}


/* =========================================================
   Password Input
   ========================================================= */

.password-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-container input {
  width: 100%;
  padding-right: 70px;
}

.toggle-password-button {
  position: absolute;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 34px;
  padding: 0 10px;
  color: #234f7d;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.toggle-password-button:hover {
  color: #183b60;
  background: #eaf1f8;
}

.toggle-password-button:focus-visible {
  outline: 2px solid #234f7d;
  outline-offset: 1px;
}

@media (max-width: 520px) {
  .brand-logo-container {
    width: 64px;
    height: 64px;
  }
}