/* QMail Login Page — Quantic Mail */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.task-login {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f1f5f9;
  min-height: 100vh;
}

/* Two-column layout */
.qm-page {
  display: flex;
  min-height: 100vh;
}

/* === LEFT BRAND PANEL === */
.qm-brand {
  flex: 0 0 42%;
  background: linear-gradient(155deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle circle decorations */
.qm-brand::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.qm-brand::after {
  content: "";
  position: absolute;
  bottom: -60px; left: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.qm-brand-inner {
  position: relative;
  z-index: 1;
}

.qm-logo-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.qm-brand-text {
  display: flex;
  flex-direction: column;
}

.qm-wordmark {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  line-height: 1;
}

.qm-tagline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

.qm-headline {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 1.2rem;
}

.qm-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  max-width: 320px;
  margin-bottom: 2.5rem;
}

.qm-features {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.qm-feat {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qm-feat-icon {
  color: #a5b4fc;
  font-size: 0.5rem;
}

.qm-brand-footer {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* === RIGHT LOGIN PANEL === */
.qm-login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f8fafc;
}

.qm-login-card {
  width: 100%;
  max-width: 420px;
}

.qm-login-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.qm-login-sub {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 2rem;
}

/* Roundcube injects a table-based form — clean it up */
.qm-form table { width: 100%; border-collapse: separate; border-spacing: 0 0.6rem; }
.qm-form td { padding: 0; }
.qm-form td.title {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.qm-form input[type="text"],
.qm-form input[type="email"],
.qm-form input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.qm-form input:focus {
  border-color: #4338ca;
  box-shadow: 0 0 0 3px rgba(67,56,202,0.12);
}

/* Submit button */
.qm-form .formbuttons,
.qm-form p.formbuttons {
  margin-top: 1.5rem;
}
.qm-form input[type="submit"],
.qm-form button[type="submit"] {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #4338ca, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.2s, transform 0.1s;
}
.qm-form input[type="submit"]:hover,
.qm-form button[type="submit"]:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Error messages */
#login-form .message.warning,
#login-form .message.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #b91c1c;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.qm-login-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .qm-page { flex-direction: column; }
  .qm-brand {
    flex: none;
    padding: 2rem;
    min-height: 220px;
  }
  .qm-headline { font-size: 1.5rem; }
  .qm-features { display: none; }
  .qm-login-panel { padding: 1.5rem; }
}
