/* ----------------------------------------
   UTLG Enterprise — Login Page
---------------------------------------- */

/* Override Materialize layout wrappers for login page */
body.login-bg {
  margin: 0 !important;
  padding: 0 !important;
  background: #0a0e1a !important;
  overflow-x: hidden;
}

body.login-bg > div.row,
body.login-bg > div.row > .col.s12,
body.login-bg > div.row > .col.s12 > .container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

#login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 20px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26, 54, 93, 0.6) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(44, 24, 76, 0.5) 0%, transparent 55%),
    linear-gradient(135deg, #0a0e1a 0%, #0f172a 50%, #0a0e1a 100%);
  background-attachment: fixed;
  box-sizing: border-box;
}

/* Subtle grid overlay */
#login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Two-panel wrapper ---- */
.login-wrapper {
  display: flex;
  width: 900px;
  max-width: 96vw;
  min-height: 540px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.06);
  position: relative;
  z-index: 1;
}

/* ---- Brand (left) panel ---- */
.login-brand {
  flex: 1;
  background:
    linear-gradient(155deg, #1a365d 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 40px;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  top: -80px;
  left: -80px;
}

.login-brand::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.1) 0%, transparent 70%);
  bottom: -50px;
  right: -50px;
}

.brand-content {
  text-align: center;
  color: #fff;
  position: relative;
  z-index: 1;
}

.brand-logo {
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  height: 80px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 4px 16px rgba(245,158,11,0.3));
}

.brand-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0 0 8px;
  color: #fff;
}

.brand-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 28px;
}

.brand-divider {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f59e0b, transparent);
  margin: 0 auto 20px;
}

.brand-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  font-style: italic;
  margin: 0;
}

/* ---- Form (right) panel ---- */
.login-form-panel {
  flex: 1.1;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 44px;
}

.login-form-inner {
  width: 100%;
  max-width: 340px;
}

.form-header {
  margin-bottom: 32px;
}

.form-header h4 {
  font-size: 22px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0 0 6px;
}

.form-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* ---- Alert ---- */
.login-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fca5a5;
  font-size: 13px;
  margin-bottom: 20px;
}

.login-alert .material-icons {
  font-size: 18px;
  flex-shrink: 0;
}

/* ---- Fields ---- */
.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.field-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.field-wrap:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.field-wrap.has-error {
  border-color: rgba(239,68,68,0.5);
}

.field-icon {
  font-size: 18px !important;
  color: rgba(255,255,255,0.3);
  padding: 0 12px;
  flex-shrink: 0;
}

.field-wrap input {
  flex: 1;
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #f9fafb !important;
  font-size: 14px;
  padding: 13px 14px 13px 0;
  height: auto !important;
  margin: 0 !important;
}

.field-wrap input::placeholder {
  color: rgba(255,255,255,0.2);
}

.field-error {
  display: block;
  font-size: 12px;
  color: #f87171;
  margin-top: 5px;
  padding-left: 2px;
}

/* ---- Remember me ---- */
.login-remember {
  margin-bottom: 28px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.remember-label input[type="checkbox"]:checked ~ .checkmark {
  background: #f59e0b;
  border-color: #f59e0b;
}

.remember-label input[type="checkbox"]:checked ~ .checkmark::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.remember-text {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  user-select: none;
}

/* ---- Submit button ---- */
.login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(245,158,11,0.35);
}

.login-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(245,158,11,0.45);
}

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

.login-btn .material-icons {
  font-size: 18px;
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .login-brand {
    display: none;
  }
  .login-wrapper {
    width: 94vw;
    min-height: auto;
    border-radius: 16px;
  }
  .login-form-panel {
    padding: 36px 28px;
  }
}
