/* ==========================================================================
   mXbyte — shadcn Auth-Fuse Clean UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background: #09090b;
  --foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --popover: #09090b;
  --popover-foreground: #fafafa;
  --card: #09090b;
  --card-foreground: #fafafa;
  --border: #27272a;
  --input: #27272a;
  --input-focus: #3f3f46;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --accent: #27272a;
  --accent-foreground: #fafafa;
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  --ring: #d4d4d8;
  --radius: 0.5rem;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Master 2-column Grid */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  width: 100%;
}

@media (min-width: 768px) {
  .auth-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Left Column: Form */
.auth-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  min-height: 100vh;
}

.top-back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.top-back-btn:hover {
  color: var(--foreground);
  background: var(--muted);
}

.auth-form-box {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: auto 0;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.auth-brand-logo {
  height: 22px;
  width: auto;
}

/* Header Text */
.auth-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.auth-header p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--foreground);
}

.shadcn-input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--input);
  background-color: var(--background);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
  outline: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shadcn-input::placeholder {
  color: #71717a;
}

.shadcn-input:focus-visible {
  border-color: #52525b;
  box-shadow: 0 0 0 1px #52525b;
}

.shadcn-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap .shadcn-input {
  padding-right: 2.5rem;
}

.toggle-eye-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.15s ease;
}

.toggle-eye-btn:hover {
  color: var(--foreground);
}

.input-error {
  font-size: 0.78rem;
  color: var(--destructive);
  font-weight: 500;
  min-height: 1rem;
}

/* Options row: remember & forgot password */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-top: -0.25rem;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--foreground);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 0;
  transition: opacity 0.15s ease;
}

.link-btn:hover {
  opacity: 0.8;
}

/* Buttons */
.shadcn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
}

.shadcn-btn-outline {
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
}

.shadcn-btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.shadcn-btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  font-weight: 600;
}

.shadcn-btn-primary:hover {
  background-color: #e4e4e7;
}

.shadcn-btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.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.6s linear infinite;
  display: none;
}

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

/* Toggle Bottom */
.auth-toggle-box {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-toggle-box .link-btn {
  margin-left: 0.25rem;
  color: var(--foreground);
}

/* Divider */
.auth-divider-wrap {
  position: relative;
  text-align: center;
  font-size: 0.875rem;
  margin: 0.5rem 0;
}

.auth-divider-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  top: 50%;
  border-top: 1px solid var(--border);
  z-index: 0;
}

.auth-divider-wrap span {
  position: relative;
  z-index: 1;
  background-color: var(--background);
  padding: 0 0.5rem;
  color: var(--muted-foreground);
}

/* Right Column: Hero Visual with Dynamic Typewriter */
.auth-right {
  display: none;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.6s ease-in-out;
}

@media (min-width: 768px) {
  .auth-right {
    display: block;
  }
}

.auth-right-fade {
  position: absolute;
  inset-x: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to top, var(--background) 0%, transparent 100%);
  pointer-events: none;
}

.auth-right-content {
  position: relative;
  z-index: 10;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem;
  padding-bottom: 2.5rem;
}

.auth-quote-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  color: var(--foreground);
  max-width: 460px;
  background: rgba(9, 9, 11, 0.4);
  padding: 1.25rem 1.75rem;
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-quote-text {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
}

.typewriter-cursor {
  display: inline-block;
  animation: cursorPulse 1s infinite;
  margin-left: 2px;
  font-weight: 300;
}

@keyframes cursorPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.auth-quote-author {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted-foreground);
  font-style: normal;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 100%;
  max-width: 400px;
  background-color: #09090b;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem 1.75rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--foreground);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modern-toast {
  background: #18181b;
  border: 1px solid #27272a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: toastFade 0.2s ease;
}

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