/* ==========================================================================
   loginstyle.css
   Place at: static/css/loginstyle.css
   Login, password reset, and auth pages for Clicked Academy
   ========================================================================== */

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

:root {
  --primary:   #0080FF;
  --secondary: #115FFB;
  --tertiary:  #5540FB;
  --white:     #ffffff;
  --card-bg:   rgba(255,255,255,0.98);
  --text-dark: #1a1a2e;
  --text-mid:  #374151;
  --text-soft: #6b7280;
  --text-fine: #9ca3af;
  --border:    #e5e7eb;
  --input-bg:  #f9fafb;
}

/* ── Base ── */
html, body {
  min-height: 100vh;
  font-family: 'DM Sans', sans-serif;
}

body {
  background: linear-gradient(176deg, #0080ff 0%, #115ffb 25%, #5540fb 50%, #b620e0 75%, #f7b500 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

/* ── Ambient blobs ── */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.25;
}

body::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
  top: -120px;
  left: -120px;
}

body::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #f7b500 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
}

/* ── Nav / Header ── */
.login-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 58px;
  position: relative;
  z-index: 10;
}

.login-nav .nav-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.login-nav .nav-logo img {
  height: 48px;
  filter: brightness(0) invert(1);
}

/* ── Main wrapper ── */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 40px;
  position: relative;
  z-index: 1;
}

/* ── Card ── */
.login-form-container,
.password-reset-form-container {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 32px 80px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  animation: cardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ── Card heading ── */
.login-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-heading img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.login-heading p {
  font-family: 'Quicksand', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

/* ── Helper text ── */
.password-reset-form-container > p,
.password-reset-form-container p:not(.login-heading p) {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 20px;
  text-align: center;
}

/* ── Form groups ── */
.login-form-group {
  margin-bottom: 14px;
}

.login-text {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 6px;
  font-family: 'DM Sans', sans-serif;
}

/* ── Inputs ── */
.login-form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  background: var(--input-bg);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.login-form-control::placeholder {
  color: var(--text-fine);
}

.login-form-control:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,128,255,0.1);
}

/* ── Remember me + forgot row ── */
.login-form-added {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.login-form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-form-check-input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.login-form-check-label {
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}

.login-forgot-pwd {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}

.login-forgot-pwd:hover {
  color: var(--tertiary);
}

/* ── Primary button ── */
.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--tertiary) 100%);
  color: #ffffff;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
  letter-spacing: 0.03em;
  transition: opacity 0.2s, transform 0.15s;
}

.login-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

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

/* ── Secondary / cancel button ── */
.cancel-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-soft);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.cancel-btn:hover {
  border-color: #c0c8d8;
  background: #f9fafb;
  color: var(--text-mid);
}

/* ── Allauth field overrides ── */
.password-reset-form-container input[type="password"],
.password-reset-form-container input[type="text"],
.password-reset-form-container input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  background: var(--input-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  margin-top: 6px;
  margin-bottom: 14px;
  box-sizing: border-box;
}

.password-reset-form-container input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,128,255,0.1);
}

.password-reset-form-container label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
}

/* ── Error messages ── */
.errorlist {
  list-style: none;
  margin: 4px 0 10px;
  padding: 0;
}

.errorlist li {
  font-size: 12px;
  color: #ef4444;
  padding: 6px 10px;
  background: rgba(239,68,68,0.07);
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-family: 'DM Sans', sans-serif;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .login-header {
    padding: 16px 24px;
  }

  .login-form-container,
  .password-reset-form-container {
    padding: 32px 24px 28px;
    border-radius: 18px;
  }
}

/* ── Status icons (reset done / success) ── */
.reset-done-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--tertiary));
  color: #ffffff;
  flex-shrink: 0;
}

.reset-done-icon svg {
  width: 24px;
  height: 24px;
}

.reset-done-icon--success {
  background: linear-gradient(135deg, #18A957, #0f7a3d);
}