:root {
  --primary: #8a63d2;
  --primary-dark: #7049bf;
  --primary-soft: #f1eaff;

  --bg: #f8f4fc;
  --bg-secondary: #efe7f8;
  --card: #ffffff;

  --text: #4a3f63;
  --text-soft: #7d7394;
  --border: #e4daf2;

  --success-bg: #e9f8ef;
  --success-text: #237548;
  --danger-bg: #fdeaea;
  --danger-text: #b23a3a;
  --warning-bg: #fff5df;
  --warning-text: #9c6f09;
  --info-bg: #eef4ff;
  --info-text: #355caa;

  --shadow: 0 18px 45px rgba(110, 79, 179, 0.12);
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Roboto", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(211, 190, 248, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(245, 216, 235, 0.22), transparent 24%),
    linear-gradient(180deg, #fcfafe 0%, var(--bg) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================
   Header
========================= */
.header {
  width: 100%;
  background: linear-gradient(180deg, #e8dbf6 0%, #e3d6f2 100%);
  border-bottom: 1px solid #ddd0ee;
  text-align: center;
  padding: 18px 20px 22px;
  position: relative;
}

.home-link {
  position: absolute;
  left: 24px;
  top: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #d9c9ef;
  background: rgba(255, 255, 255, 0.84);
  color: #6b4cb8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.home-link:hover {
  background: #ffffff;
  border-color: #ccb8eb;
  color: #5c3ea7;
  transform: translateY(-1px);
}

.header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #5b36a7;
  line-height: 1.2;
}

.header p {
  margin: 8px auto 0;
  max-width: 460px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #7b6f95;
}



/* =========================
   Flash messages
========================= */
.flash-messages {
  width: 100%;
  max-width: 560px;
  margin: 24px auto 0;
  padding: 0 16px;
}

.alert {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid transparent;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.03);
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #cfe9d9;
}

.alert.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: #f2c7c7;
}

.alert.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: #f3e0af;
}

.alert.info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: #d7e5ff;
}

/* =========================
   Main
========================= */
.main-container {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 36px 16px 40px;
}

.login-container {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  backdrop-filter: blur(8px);
}

.login-container h1 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* =========================
   Form
========================= */
form {
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.form-group label {
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0 15px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.form-group input::placeholder {
  color: #a197b7;
}

.form-group input:focus {
  border-color: #b99bf0;
  box-shadow: 0 0 0 4px rgba(149, 110, 232, 0.12);
}

.submit-btn {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 14px 24px rgba(111, 79, 176, 0.2);
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 16px 28px rgba(111, 79, 176, 0.24);
}

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

.submit-btn:focus {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(149, 110, 232, 0.14),
    0 14px 24px rgba(111, 79, 176, 0.2);
}

/* =========================
   Forgot password
========================= */
.forgot-password {
  text-align: center;
  margin-top: 18px;
}

.forgot-password a {
  text-decoration: none;
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.forgot-password a:hover {
  color: #5d36a8;
  opacity: 0.92;
}

/* =========================
   Footer
========================= */
.footer {
  width: 100%;
  text-align: center;
  padding: 18px 16px 22px;
  border-top: 1px solid #ded2f1;
  background: rgba(245, 240, 251, 0.75);
  color: #6e59a7;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer em {
  font-style: normal;
  font-weight: 700;
}

/* =========================
   Responsive
========================= */
@media (max-width: 640px) {
  .header {
    padding: 12px 14px 14px;
  }

  .header-top {
    margin-bottom: 8px;
  }

  .back-home-btn {
    padding: 7px 12px;
    font-size: 0.88rem;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .header p {
    font-size: 0.86rem;
    max-width: 300px;
  }

  .main-container {
    padding: 26px 12px 30px;
    align-items: flex-start;
  }

  .login-container {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .login-container h1 {
    font-size: 1.6rem;
    margin-bottom: 18px;
  }

  .form-group input,
  .submit-btn {
    height: 50px;
  }

  .footer {
    font-size: 0.84rem;
    padding: 16px 12px 20px;
  }
}

