/* =========================================================
   NOKOS.MY.ID MODERN AUTH UI (Login & Register)
   Dark Slate Navy Aesthetic — Clean, responsive, self-contained
   ========================================================= */

@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 {
  --bg-main: #07080b;
  --card-bg: rgba(15, 23, 42, 0.78);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(11, 19, 36, 0.88);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
}

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

body.auth-body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow background */
.auth-ambient-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  height: 400px;
  background: radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, 0.22), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-ambient-glow-2 {
  position: fixed;
  bottom: -80px;
  right: 15%;
  width: 450px;
  height: 350px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 428px;
}

/* Brand header */
.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.auth-brand-link:hover {
  opacity: 0.9;
}

.auth-brand-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
}

.auth-brand-titles {
  display: flex;
  flex-direction: column;
}

.auth-brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.auth-brand-sub {
  font-size: 11px;
  color: #60a5fa;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

/* Card */
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px;
    border-radius: 16px;
  }
}

/* Card Header */
.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-title {
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* OAuth Grid */
.oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 360px) {
  .oauth-grid {
    grid-template-columns: 1fr;
  }
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10.5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
}

.oauth-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.oauth-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  position: relative;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 7px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: #f8fafc;
  padding: 12px 14px;
  font-size: 14.5px;
  transition: all 0.2s ease;
  font-family: inherit;
}

@media (max-width: 640px) {
  .form-input {
    font-size: 16px; /* Prevents auto-zoom in mobile safari & chrome */
  }
}

.form-input:focus {
  border-color: var(--input-focus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.form-input::placeholder {
  color: #475569;
}

.pw-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.pw-toggle-btn:hover {
  color: #ffffff;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Password strength */
.password-strength {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 8px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pw-weak { background: #ef4444; }
.pw-fair { background: #f59e0b; }
.pw-good { background: #3b82f6; }
.pw-strong { background: #10b981; }

/* Error message */
.error-message {
  display: none;
  color: #fca5a5;
  font-size: 13px;
  text-align: left;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  margin-bottom: 18px;
  line-height: 1.4;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12.5px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  font-family: inherit;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

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

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Terms note */
.terms-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 12px 0 6px;
  line-height: 1.45;
}

.terms-note a {
  color: #60a5fa;
  text-decoration: none;
}

.terms-note a:hover {
  text-decoration: underline;
}

/* Footer Link */
.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: inline-block;
}

.hidden {
  display: none !important;
}

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

/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.4);
  background: #062419;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: #2b1113;
}

