/* ═══════════════════════════════════════════════════════════════════
   Zaventra Music Group — Modern Split-Screen Workstation Login
   Pixel-accurate layout matching reference design with theme accents
   ═══════════════════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --theme-primary: #2563eb;
  --theme-primary-hover: #1d4ed8;
  --theme-primary-focus: rgba(37, 99, 235, 0.15);
  --text-main: #101828;
  --text-label: #344054;
  --text-muted: #667085;
  --border-input: #d0d5dd;
  --border-radius: 8px;
  --danger: #d92d20;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #ffffff;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden {
  display: none !important;
}

/* ═══ 50/50 SPLIT SCREEN LAYOUT ═══ */
.login-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: #ffffff;
}

/* ─── LEFT PANE (FORM) ─── */
.login-left-pane {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: #ffffff;
  box-sizing: border-box;
}

.login-box {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

/* ─── BRAND LOGO & SUBTITLE ─── */
.login-brand-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand {
  display: inline-block;
  text-decoration: none;
}

.login-logo {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.login-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: -0.01em;
}

/* ─── FORM GROUPS ─── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-label);
  margin-bottom: 6px;
  line-height: 1.3;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-input);
  border-radius: var(--border-radius);
  background: #ffffff;
  color: var(--text-main);
  font: 500 14px 'Manrope', -apple-system, sans-serif;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: #98a2b3;
}

.form-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 4px var(--theme-primary-focus);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.1);
}

/* ─── PASSWORD FIELD & EYE TOGGLE ─── */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input {
  padding-right: 44px;
}

.eye-toggle-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.eye-toggle-btn:hover {
  color: #344054;
  background: #f2f4f7;
}

.eye-toggle-btn svg {
  width: 19px;
  height: 19px;
}

/* Default state: show open eye (password is hidden) */
.eye-toggle-btn .icon-eye-closed {
  display: none;
}
.eye-toggle-btn.visible .icon-eye-open {
  display: none;
}
.eye-toggle-btn.visible .icon-eye-closed {
  display: block;
}

/* ─── OPTIONS ROW ─── */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-label);
  cursor: pointer;
  user-select: none;
}

.remember-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  accent-color: var(--theme-primary);
  cursor: pointer;
}

.forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-primary);
  text-decoration: none;
  transition: color 0.15s;
}

.forgot-link:hover {
  text-decoration: underline;
  color: var(--theme-primary-hover);
}

/* ─── SIGN IN BUTTON (THEME COLOR WITH OUTLINE HOVER) ─── */
.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border: 1.5px solid var(--theme-primary);
  border-radius: var(--border-radius);
  background: var(--theme-primary);
  color: #ffffff;
  font: 600 14px 'Manrope', -apple-system, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover {
  background: #ffffff;
  color: var(--theme-primary);
  border-color: var(--theme-primary);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.submit-btn:hover .btn-spinner {
  border-color: rgba(37, 99, 235, 0.25);
  border-top-color: var(--theme-primary);
}

.submit-btn:active {
  transform: scale(0.99);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── ERROR ALERTS ─── */
.field-error {
  min-height: 16px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
}

.alert-error {
  min-height: 18px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--danger);
  text-align: center;
}

.caps-hint {
  font-size: 12px;
  color: #b54708;
  margin-top: 4px;
}

/* ─── OTP STEP PANEL ─── */
.otp-header {
  text-align: center;
  margin-bottom: 22px;
}

.otp-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.otp-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.otp-email-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 6px;
  background: #f2f4f7;
  font: 500 12.5px 'DM Mono', monospace;
  color: var(--text-label);
}

.otp-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 6px;
}

.otp-input {
  width: 48px;
  height: 54px;
  text-align: center;
  font: 700 22px 'DM Mono', monospace;
  border: 1px solid var(--border-input);
  border-radius: var(--border-radius);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.otp-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px var(--theme-primary-focus);
}

.otp-input.filled {
  border-color: #039855;
  background: #f6fef9;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px auto 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: 600 13px 'Manrope', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.btn-back:hover {
  color: var(--text-main);
  text-decoration: none;
}

.btn-back svg {
  width: 16px;
  height: 16px;
}

/* ─── AUTH PAGE TITLE & HEADINGS ─── */
.auth-heading {
  margin-bottom: 24px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ─── SUCCESS CONFIRMATION STATE ─── */
.auth-success-card {
  text-align: center;
  padding: 16px 0 8px;
}

.auth-success-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf3;
  color: #12b76a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 0 0 8px #f6fef9;
}

.auth-success-icon-wrap svg {
  width: 28px;
  height: 28px;
}

/* ═══ RIGHT PANE: GEOMETRIC MOSAIC ARTWORK (RIGHT-ALIGNED) ═══ */
.login-right-pane {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 44px 40px 20px;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
}

.mosaic-art-wrapper {
  width: auto;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  margin-right: 0;
}

.mosaic-svg {
  width: auto;
  height: calc(100vh - 88px);
  max-height: calc(100vh - 88px);
  max-width: 100%;
  display: block;
}

/* ═══ FULLSCREEN PAGE LOADER (PURE CSS MINIMALIST) ═══ */
.zmg-loader-wrap {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.zmg-loader-wrap.hidden,
.zmg-loader-wrap.zmg-loader-done {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.zmg-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  user-select: none;
}

.zmg-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 3.5px solid #ede9fe;
  border-top-color: #6366f1;
  animation: zmgSpin 0.75s linear infinite;
}

.zmg-loader-text {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0;
}

@keyframes zmgSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .zmg-spinner {
    animation-duration: 2.5s;
  }
}

.zmg-loader-gif {
  display: none !important;
}

/* ═══ RESPONSIVE BREAKPOINTS ═══ */
@media (max-width: 900px) {
  .login-layout {
    flex-direction: column;
  }
  .login-right-pane {
    display: none; /* Mobile focuses cleanly on the login form */
  }
  .login-left-pane {
    min-height: 100vh;
    padding: 32px 20px;
  }
}
