/* ==========================================================================
   ManisCare • Sugar Mill Maintenance Portal
   Design System & Styling (Compact, Pixel-Accurate & 100vh Fit)
   PT Sinergi Gula Nusantara (SGN)
   ========================================================================== */

:root {
  /* Brand Color Palette */
  --brand-primary: #1e3e34;
  --brand-primary-hover: #152e26;
  --brand-primary-active: #0d1e18;
  --brand-primary-subtle: #f0f5f2;
  --brand-primary-glow: rgba(30, 62, 52, 0.12);

  /* Industrial Accent Colors */
  --accent-gold: #f59e0b;
  --accent-success: #10b981;
  --accent-danger: #ef4444;

  /* Neutral Surface & Backgrounds */
  --bg-page: #f9f8f6;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-input-hover: #fafafa;

  /* Neutral Borders */
  --border-default: #e5e7eb;
  --border-hover: #cbd5e1;
  --border-focus: #1e3e34;

  /* Typography Colors */
  --text-primary: #111827;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-on-brand: #ffffff;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-button: 0 2px 8px rgba(30, 62, 52, 0.2);
  --shadow-button-hover: 0 4px 14px rgba(30, 62, 52, 0.28);

  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 7px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-page);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   Main Split Layout (Fits Exactly 100vh without page scroll)
   ========================================================================== */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   LEFT: Hero Section (Industrial Machinery Photo)
   ========================================================================== */
.hero-section {
  position: relative;
  flex: 1.4;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 40px;
  background-color: #121815;
}

.hero-image-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-section:hover .hero-image {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 20, 16, 0.88) 0%, rgba(10, 20, 16, 0.3) 25%, transparent 50%);
  pointer-events: none;
}

/* Bottom Hero Caption (Exact Match to Screenshot) */
.hero-bottom-caption {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.caption-dash {
  display: inline-block;
  width: 26px;
  height: 2px;
  background-color: #ffffff;
  opacity: 0.95;
  border-radius: 1px;
}

.caption-text {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   RIGHT: Authentication Section (Clean, Executive & Compact)
   ========================================================================== */
.auth-section {
  flex: 0.92;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 32px;
  background-color: var(--bg-page);
}

.auth-container {
  width: 100%;
  max-width: 380px;
  margin: auto;
  display: flex;
  flex-direction: column;
}

/* Header & Logo */
.auth-header {
  text-align: center;
  margin-bottom: 16px;
}

.logo-wrapper {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-normal);
}

.brand-logo:hover {
  transform: scale(1.02);
}

.auth-title {
  font-size: 25px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 5px;
}

.auth-subtitle {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Demo Quick-Fill Pills (Discreet, Pro & Space-Efficient) */
.demo-pills {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  background-color: rgba(30, 62, 52, 0.05);
  border-radius: var(--radius-full);
}

.pills-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-primary);
  margin-right: 2px;
}

.pill-btn {
  background: #ffffff;
  border: 1px solid rgba(30, 62, 52, 0.15);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.pill-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.pill-btn.active {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.input-icon.left-icon {
  left: 13px;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: 
    border-color var(--transition-fast), 
    box-shadow var(--transition-fast), 
    background-color var(--transition-fast);
}

.form-control::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-control:hover {
  background-color: var(--bg-input-hover);
  border-color: var(--border-hover);
}

.form-control:focus {
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.input-wrapper:focus-within .input-icon.left-icon {
  color: var(--brand-primary);
}

.form-control.has-right-action {
  padding-right: 42px;
}

/* Clear User Button */
.clear-input-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: none;
  border-radius: 50%;
}

.clear-input-btn svg {
  width: 14px;
  height: 14px;
}

.clear-input-btn:hover {
  color: var(--text-primary);
}

/* Password Toggle Button */
.input-action-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.input-action-btn:hover {
  color: var(--text-primary);
}

.input-action-btn svg {
  width: 18px;
  height: 18px;
}

.hidden {
  display: none !important;
}

.field-error {
  font-size: 11px;
  color: var(--accent-danger);
  margin-top: 3px;
  display: none;
}

.form-group.has-error .field-error {
  display: block;
}

.form-group.has-error .form-control {
  border-color: var(--accent-danger);
}

/* ==========================================================================
   Custom Select Dropdown: Periode
   ========================================================================== */
.custom-select-container {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 38px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  display: flex;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: 
    border-color var(--transition-fast), 
    box-shadow var(--transition-fast), 
    background-color var(--transition-fast);
  user-select: none;
}

.custom-select-trigger:hover {
  background-color: var(--bg-input-hover);
  border-color: var(--border-hover);
}

.custom-select-container.is-open .custom-select-trigger {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.custom-select-container.is-open .left-icon {
  color: var(--brand-primary);
}

.select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.select-chevron svg {
  width: 15px;
  height: 15px;
}

.custom-select-container.is-open .select-chevron {
  transform: translateY(-50%) rotate(180deg);
  color: var(--brand-primary);
}

/* Dropdown Menu */
.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  list-style: none;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: 
    opacity var(--transition-fast), 
    transform var(--transition-fast), 
    visibility var(--transition-fast);
}

.custom-select-container.is-open .custom-select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
}

.custom-option:hover {
  background-color: var(--brand-primary-subtle);
  color: var(--brand-primary);
}

.custom-option.selected {
  background-color: rgba(30, 62, 52, 0.08);
  color: var(--brand-primary);
  font-weight: 600;
}

.option-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-muted);
}

.option-tag.current {
  background: #dcfce7;
  color: #15803d;
}

.check-icon {
  width: 14px;
  height: 14px;
  stroke: var(--brand-primary);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.custom-option.selected .check-icon {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   Submit Button
   ========================================================================== */
.btn-submit {
  width: 100%;
  height: 42px;
  margin-top: 2px;
  background-color: var(--brand-primary);
  color: var(--text-on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: 
    background-color var(--transition-fast), 
    box-shadow var(--transition-fast), 
    transform var(--transition-fast);
  position: relative;
}

.btn-submit:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

.btn-submit:active {
  background-color: var(--brand-primary-active);
  transform: translateY(0);
}

.btn-submit.loading {
  pointer-events: none;
  background-color: var(--brand-primary-hover);
}

.btn-submit.loading .btn-content {
  opacity: 0;
}

.btn-submit.loading .btn-spinner {
  display: flex !important;
}

.btn-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-svg {
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

.spinner-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.25);
}

.spinner-head {
  fill: none;
  stroke: #ffffff;
  stroke-dasharray: 45;
  stroke-dashoffset: 15;
  stroke-linecap: round;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Helper Text & Footer
   ========================================================================== */
.helper-text {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.35;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
}

.company-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Interactive Toast Notification
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  min-width: 260px;
  max-width: 380px;
  transform: translateY(15px);
  opacity: 0;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  background-color: #064e3b;
  border: 1px solid #059669;
}

.toast.toast-info {
  background-color: #0f172a;
  border: 1px solid #334155;
}

.toast.toast-error {
  background-color: #7f1d1d;
  border: 1px solid #dc2626;
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-message {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

@keyframes toastIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-height: 700px) {
  .auth-section {
    padding: 12px 24px;
  }
  .brand-logo {
    height: 50px;
  }
  .logo-wrapper {
    margin-bottom: 8px;
  }
  .auth-title {
    font-size: 22px;
  }
  .auth-subtitle {
    font-size: 12.5px;
    margin-bottom: 6px;
  }
  .form-group {
    gap: 2px;
  }
  .auth-form {
    gap: 9px;
  }
  .form-control, .custom-select-trigger, .btn-submit {
    height: 38px;
  }
  .auth-footer {
    margin-top: 14px;
    padding-top: 10px;
  }
}

@media (max-width: 820px) {
  html, body, .app-layout {
    height: auto;
    overflow-y: auto;
  }

  .app-layout {
    flex-direction: column;
  }

  .hero-section {
    flex: none;
    height: 35vh;
    min-height: 240px;
    padding: 20px 20px;
  }

  .auth-section {
    flex: 1;
    height: auto;
    min-height: auto;
    padding: 30px 20px 40px;
    margin-top: -16px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
    z-index: 10;
  }
}

.demo-account-label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-account-select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font: 600 11px 'Plus Jakarta Sans', sans-serif;
}

.demo-account-select:focus {
  border-color: var(--border-focus);
  outline: 3px solid var(--brand-primary-glow);
}

/* Flow Guide Box on Login Page */
.flow-guide-box {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(30, 62, 52, 0.05);
  border: 1px solid rgba(30, 62, 52, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-guide-title {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-primary);
}
.flow-steps-mini {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 9.5px;
  color: var(--text-secondary);
}
.flow-steps-mini span {
  background: white;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  white-space: nowrap;
}
.flow-steps-mini span b {
  color: var(--brand-primary);
  margin-right: 2px;
}
