/* =============================================
   MOTARIO — Login Page
   Standalone styles for authentication pages
   Used by: login, register pages ONLY
   Self-contained: includes its own reset
   (does NOT load layout.css / components.css)
   ============================================= */

/* ---- Reset (required: login skips layout.css) ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

/* ---- Full-screen layout with color effects ---- */
.login-page {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(var(--primary-rgb), 0.30), transparent 65%),
    radial-gradient(ellipse 50% 45% at 10% 85%, rgba(var(--primary-rgb), 0.18), transparent 60%),
    radial-gradient(ellipse 45% 40% at 50% 100%, rgba(var(--info-rgb), 0.12), transparent 70%),
    linear-gradient(150deg, #0a1730 0%, var(--sidebar-bg) 45%, #0d1f3d 100%);
}

/* Decorative floating glows (pure CSS) */
.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.login-page::before {
  width: 340px;
  height: 340px;
  top: -110px;
  right: -90px;
  background: rgba(var(--primary-rgb), 0.28);
}

.login-page::after {
  width: 280px;
  height: 280px;
  bottom: -90px;
  left: -70px;
  background: rgba(var(--primary-rgb), 0.16);
}

/* ---- Login Card ---- */
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: loginFadeIn 0.4s ease;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Logo Area ---- */
.login-brand {
  text-align: center;
  padding: var(--space-6) var(--space-5) var(--space-3);
}

.login-brand .brand-icon {
  width: 50px;
  height: 50px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--text-on-primary);
  margin-bottom: var(--space-3);
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.35);
}

.login-brand h1 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.login-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Error Message ---- */
.login-error {
  margin: 0 var(--space-5) var(--space-3);
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(var(--danger-rgb), 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---- Form ---- */
.login-form {
  padding: var(--space-2) var(--space-5) var(--space-4);
}

.login-form .form-group {
  margin-bottom: var(--space-3);
}

.login-form .form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
  display: block;
}

/* ---- Input Group ---- */
.input-group {
  position: relative;
}

.input-group .input-icon {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
  pointer-events: none;
}

.input-group .form-control {
  width: 100%;
  padding: 9px 38px 9px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border 0.15s, box-shadow 0.15s;
  display: block;
}

.input-group .form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.input-group .form-control::placeholder {
  color: var(--text-muted);
}

/* Password field: room for toggle on the left */
.input-group.has-toggle .form-control {
  padding-left: 38px;
}

/* ---- Password Toggle ---- */
.password-toggle {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 4px;
}

.password-toggle:hover {
  color: var(--primary);
}

/* ---- Remember Me ---- */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  font-size: 0.8rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

/* ---- Submit Button ---- */
.login-submit {
  width: 100%;
  padding: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--text-on-primary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.login-submit:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
}

.login-submit:active {
  transform: scale(0.98);
}

/* ---- Footer ---- */
.login-footer {
  text-align: center;
  padding: var(--space-3);
  background: var(--gray-50);
  border-top: 1px solid var(--border);
}

.login-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ---- Short viewports: allow scroll as safety valve ---- */
@media screen and (max-height: 560px) {
  html,
  body {
    overflow: auto;
  }

  .login-page {
    height: auto;
    min-height: 100%;
    padding: var(--space-3);
  }
}
