/* ============================================================
   Login Page — Kraffz Mail
   ============================================================ */
@keyframes pageEntry {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

body {
  font-family: var(--font-family);
  background: var(--gradient-bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.28) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(99,102,241,0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 80%, rgba(167,139,250,0.18) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Layout ── */
.container {
  max-width: 1080px;
  width: 100%;
  display: flex;
  gap: 36px;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: pageEntry 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Login card section (right) ── */
.login-section {
  flex: 0 0 420px;
  max-width: 420px;
}

.card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-2xl);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), 0 8px 20px rgba(99, 102, 241, 0.18);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: pageEntry 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
  transition: var(--transition-slow);
}

.card-header {
  background: var(--gradient-primary);
  padding: 32px 32px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-header::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 65%);
  pointer-events: none;
}

/* Language buttons in header */
.lang-row {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 5px;
  z-index: 2;
}

.lang-btn {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.18);
  color: white;
  font-family: var(--font-family);
  transition: var(--transition);
  letter-spacing: 0.04em;
}
.lang-btn:hover,
.lang-btn.active {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.7);
}

/* Logo icon */
.login-logo {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  position: relative;
  z-index: 1;
}
.login-logo svg {
  width: 28px;
  height: 28px;
  stroke: white;
}

.card-header h1 {
  color: white;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 5px;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.subtitle {
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Card body */
.card-body {
  padding: 28px 32px 32px;
}

/* ── Form elements ── */
.form-group { margin-bottom: 18px; }

label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-subtle);
  transition: var(--transition);
  line-height: 1.5;
  outline: none;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-muted);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input[readonly] {
  background: var(--bg-subtle);
  cursor: default;
}

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
  z-index: 2;
  line-height: 1;
}
.toggle-password:hover { color: var(--primary); background: rgba(99,102,241,0.08); }
.toggle-password.active { color: var(--primary); }
.toggle-password svg { width: 17px; height: 17px; display: block; pointer-events: none; }
.input-wrapper input[type="password"],
.input-wrapper input[type="text"] { padding-right: 42px !important; }

/* Input hint */
.input-hint {
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Forgot password link */
.forgot-link {
  display: block;
  text-align: right;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.forgot-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* Buttons */
.button-group { margin-top: 8px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-primary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-lg);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--primary-muted);
  color: var(--primary);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 16px 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.checkbox-group label {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.55;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}
.checkbox-group label a { color: var(--primary); text-decoration: underline; }

small {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

/* Alert */
#alertContainer .alert {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-muted); color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: var(--danger-muted);  color: #7f1d1d; border-color: #fecaca; }
.alert-info    { background: var(--info-muted);    color: #1e3a8a; border-color: #bfdbfe; }

/* OTP input */
#resetPasswordOTP { text-align: center; letter-spacing: 3px; font-size: 20px; font-weight: 700; }

/* ── Info / Feature panel (left side) ── */
.info-section {
  flex: 1;
  max-width: 540px;
  color: white;
}

.info-card {
  padding: 8px 4px;
}

.info-card h2 {
  font-size: 28px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.info-card > .subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
  font-weight: 400;
}

/* Feature list */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  padding: 13px 16px;
  backdrop-filter: blur(4px);
  transition: var(--transition);
}
.feature-item:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
  transform: translateX(4px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

.feature-content h3 {
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin-bottom: 3px;
}

.feature-content p {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  margin: 0;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  color: white;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.platform-badge {
  padding: 2px 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

/* Stats row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.stat-item {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
  font-weight: 500;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  margin-top: 16px;
  width: 100%;
  max-width: 1080px;
  position: relative;
  z-index: 1;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .container {
    flex-direction: column-reverse;
    align-items: center;
    gap: 24px;
  }
  .login-section {
    flex: none;
    width: 100%;
    max-width: 480px;
  }
  .info-section {
    max-width: 480px;
    width: 100%;
  }
  .info-card h2 { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  body { padding: 12px; }
  .card-body { padding: 20px; }
  .card-header { padding: 24px 20px 20px; }
  .info-section { display: none; }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: scale(0.92) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-box {
  background: white;
  border-radius: var(--radius-2xl, 20px);
  box-shadow: 0 24px 60px rgba(15,23,42,0.22);
  padding: 36px 32px 28px;
  max-width: 400px;
  width: 92%;
  text-align: center;
  animation: modalPop 0.3s cubic-bezier(0.4,0,0.2,1) both;
}
.modal-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 6px;
}
.modal-desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 18px;
}
.modal-userid-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md, 10px);
  padding: 12px 18px;
  margin-bottom: 10px;
}
.modal-userid-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #6366f1;
  font-family: monospace, var(--font-family);
}
.modal-copy-btn {
  padding: 6px 14px;
  border: 1.5px solid #6366f1;
  border-radius: var(--radius-sm, 6px);
  background: #eef2ff;
  color: #6366f1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.modal-copy-btn:hover {
  background: #6366f1;
  color: white;
}
.modal-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 18px;
}
.modal-continue-btn {
  margin-top: 6px;
}
