/* Palette taken off the logo: deep navy wordmark, blue-to-violet mark. */
:root {
  --navy:        #0f1a3d;
  --ink:         #16233f;
  --blue:        #2563eb;
  --blue-soft:   #3b82f6;
  --violet:      #7c3aed;
  --muted:       #5b6b8c;
  --line:        #dfe6f5;
  --field-line:  #d8e1f2;
  --placeholder: #9fb0cd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

body {
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(760px 480px at 92% 108%, rgba(124, 58, 237, 0.14), transparent 60%),
    linear-gradient(160deg, #f6f9ff 0%, #e9eff9 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 1.75rem;
  box-shadow: 0 24px 50px -14px rgba(15, 26, 61, 0.28),
              0 2px 6px rgba(15, 26, 61, 0.05),
              inset 0 1px 2px rgba(255, 255, 255, 0.7);
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.6rem 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  margin: 0 auto;
}

/* Echoes the gradient running through the logo mark. */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-soft) 45%, var(--violet) 100%);
}

.brand {
  text-align: center;
  margin-bottom: 1.8rem;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
  margin: 0.2rem auto 0.7rem;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.brand .product {
  /* inline-block so the gradient box hugs the words - on a full-width block
     the letters would only sample the middle of the ramp. */
  display: inline-block;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
  color: var(--blue);
  margin-bottom: 0.6rem;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand .product {
    background: linear-gradient(100deg, var(--blue) 0%, #4f46e5 52%, var(--violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.brand .divider {
  width: 56px;
  height: 2px;
  margin: 0 auto 0.7rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  opacity: 0.55;
}

.brand .sub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.4px;
}

.error-message {
  background: #fdeaec;
  color: #8a1c2b;
  padding: 10px 15px;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 14px;
  border: 1px solid #f6ccd2;
}

.success-message {
  background: #e8f7ee;
  color: #146c43;
  padding: 10px 15px;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 14px;
  border: 1px solid #c3e9d3;
}

.input-group {
  margin-bottom: 1.2rem;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.input-field {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 3rem;
  font-size: 1rem;
  color: var(--ink);
  background: #fbfcff;
  border: 1.5px solid var(--field-line);
  border-radius: 50px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: inset 0 2px 4px rgba(15, 26, 61, 0.03);
  -webkit-appearance: none;
  appearance: none;
}

.input-field:focus {
  background: #fff;
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16), inset 0 2px 4px rgba(15, 26, 61, 0.02);
}

.input-field:focus + .input-icon,
.input-icon-wrapper:focus-within .input-icon {
  color: var(--blue);
}

.input-field::placeholder {
  color: var(--placeholder);
  font-weight: 300;
  font-size: 0.95rem;
}

.input-icon-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8fa4c6;
  font-size: 1.2rem;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  width: 1.5rem;
  height: 1.5rem;
  transition: color 0.2s;
}

.input-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.password-toggle {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #8fa4c6;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
}

.password-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
}

.password-toggle:active {
  background: rgba(37, 99, 235, 0.14);
  transform: translateY(-50%) scale(0.95);
}

.password-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.forgot-row {
  text-align: right;
  margin-top: -0.6rem;
}

.forgot-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

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

.link-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.otp-field {
  letter-spacing: 0.5em;
  text-align: center;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.btn-login {
  background: linear-gradient(135deg, var(--blue) 0%, #4f46e5 55%, var(--violet) 100%);
  border: none;
  padding: 0.95rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.05rem;
  color: white;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 12px 22px -8px rgba(37, 99, 235, 0.55);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  touch-action: manipulation;
  width: 100%;
}

.btn-login:hover {
  filter: brightness(1.06);
  box-shadow: 0 16px 26px -8px rgba(37, 99, 235, 0.6);
}

.btn-login:active {
  transform: scale(0.975);
  box-shadow: 0 8px 16px -8px rgba(37, 99, 235, 0.5);
}

.register-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.register-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-register {
  background: rgba(124, 58, 237, 0.05);
  border: 1.5px solid rgba(124, 58, 237, 0.4);
  color: #5b21b6;
  padding: 0.5rem 1.4rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(2px);
  touch-action: manipulation;
  text-decoration: none;
}

.btn-register:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: var(--violet);
}

.btn-register:active {
  background: var(--violet);
  border-color: var(--violet);
  color: white;
  transform: scale(0.95);
}

/* SVG Icon Styles */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
}

.icon-sm {
  width: 1em;
  height: 1em;
}
.icon-store { color: var(--blue); }
.icon-label { color: var(--blue-soft); }
.icon-signin { color: white; }
.icon-user-plus { color: #5b21b6; }
.btn-register:active .icon-user-plus { color: white; }

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
  padding-left: 1.1rem;
}

@media (max-width: 480px) {
  .login-card { padding: 1.6rem 1.2rem 1.4rem; border-radius: 1.5rem; }
  .brand { margin-bottom: 1.5rem; }
  .brand-logo { max-width: 120px; margin-bottom: 0.6rem; }
  .brand .product { font-size: 1.6rem; margin-bottom: 0.5rem; }
  .input-field { padding: 0.75rem 3rem; font-size: 0.95rem; }
  .input-icon { left: 0.9rem; font-size: 1rem; width: 1.2rem; height: 1.2rem; }
  .password-toggle { right: 0.6rem; width: 2.2rem; height: 2.2rem; }
  .password-toggle svg { width: 1rem; height: 1rem; }
  .btn-login { padding: 0.85rem; font-size: 1rem; }
  .btn-register { padding: 0.4rem 1.2rem; font-size: 0.85rem; }
}
@media (max-width: 380px) {
  .login-card { padding: 1.3rem 1rem; }
  .brand-logo { max-width: 106px; }
  .brand .product { font-size: 1.45rem; }
  .input-field { padding: 0.65rem 2.5rem; font-size: 0.9rem; }
  .input-icon { left: 0.7rem; font-size: 0.9rem; width: 1rem; height: 1rem; }
  .password-toggle { right: 0.4rem; width: 2rem; height: 2rem; }
}
@supports (-webkit-touch-callout: none) {
  .input-field { font-size: 16px; }
}
