@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  --primary: #19e87d;
  --primary-hover: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #34634b, #13f07e);
  --bg-color: #88c08d;
  --box-bg: #f6f6f6;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --input-bg: #ffffff;
  --icon-color: #9ca3af;
  --check-bg: var(--primary);
  --link-color: var(--primary);

  --bg-grid:
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

body.dark-mode {
  --primary: #19e87d;
  --primary-hover: #3b82f6;
  --bg-color: #0f172a;
  --box-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --input-bg: #0f172a;
  --icon-color: #64748b;
  --link-color: var(--primary);

  --bg-grid:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

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

/* Remove number input spin buttons globally */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  background-image: var(--bg-grid);
  background-size: 40px 40px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
  position: relative;
  padding: 20px;
}
/* =================================Theme Toggle ========================= */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 30px;
  background: #e2e8f0;
  border-radius: 30px;
  padding: 4px;
  display: flex;
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.dark-mode .theme-toggle {
  background: #334155;
}

.theme-toggle__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 60px;
  height: 30px;
  background: transparent;
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  padding: 0 5px;
}

.theme-toggle__icon {
  color: #64748b;
  z-index: 1;
}

body.dark-mode .theme-toggle__icon {
  color: #e2e8f0;
}

.theme-toggle__icon--sun {
  color: #f59e0b;
}

body.dark-mode .theme-toggle__icon--sun {
  color: #94a3b8;
}

.theme-toggle__icon--moon {
  color: #38bdf8;
}

.theme-toggle__label::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-toggle__input:checked + .theme-toggle__label::after {
  transform: translateX(30px);
}
/* ======================================= Login ============================== */
.login {
  display: flex;
  width: 100%;
  max-width: 950px;
  background: var(--box-bg);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  min-height: 550px;
}

.login__panel {
  display: flex;
  flex-direction: column;
}

.login__panel--left {
  width: 48%;
  background: var(--primary-gradient);
  color: white;
  padding: 40px;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login__panel--left::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.15) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  pointer-events: none;
}

.login__panel--right {
  width: 52%;
  padding: 50px;
  justify-content: center;
}

.login__content--left {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 30px;
}
.login__header {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login__logo-text {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 5px;
  background: linear-gradient(to right, #ffffff, #c7d2fe, #fbcfe8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  text-transform: uppercase;
  font-family: "Poppins", "Inter", sans-serif;
}

.login__logo-badge {
  background: linear-gradient(90deg, var(--primary), #51b932, #a9b42d);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login__heading {
  font-size: 30px;
  line-height: 1.4;
  margin-bottom: 20px;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login__description {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 90%;
  margin: 0 auto;
}

.login__footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}
/* ======================================= Login Form ============================== */
.login-form {
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
}

.login-form__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-form__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.login-form__link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.login-form__link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.login-form__link--forgot {
  font-size: 13px;
}

.login-form__group {
  margin-bottom: 20px;
}

.login-form__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-form__label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.login-form__label-row .login-form__label {
  margin-bottom: 0;
}

.login-form__input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.login-form__icon {
  position: absolute;
  color: var(--icon-color);
}

.login-form__icon--left {
  left: 14px;
}

.login-form__icon--right {
  position: static;
}

.login-form__input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-main);
  background-color: var(--input-bg);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: inherit;
}

.login-form__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 232, 125, 0.15);
}

.login-form__input::placeholder {
  color: var(--icon-color);
}

.login-form__toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--icon-color);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.login-form__toggle-password:hover {
  color: var(--text-main);
}

.login-form__checkbox-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.login-form__checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 16px;
  width: 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.2s;
}

.login-form__checkbox-label:hover
  .login-form__checkbox-input
  ~ .login-form__checkmark {
  border-color: var(--check-bg);
}

.login-form__checkbox-input:checked ~ .login-form__checkmark {
  background-color: var(--check-bg);
  border-color: var(--check-bg);
}

.login-form__checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.login-form__checkbox-input:checked ~ .login-form__checkmark:after {
  display: block;
}

.login-form__checkmark:after {
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Submit Button */
.login-form__submit-btn {
  width: 100%;
  padding: 14px;
  background-color: #127a6b;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s,
    box-shadow 0.2s;
  font-family: inherit;
}

.login-form__submit-btn:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(32, 203, 114, 0.3);
  transform: translateY(-1px);
}

.login-form__submit-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.login-form__back {
  text-align: center;
  margin-top: 24px;
}

.login-form__link--back {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.login-form__link--back:hover {
  color: var(--text-main);
  text-decoration: none;
}
/* ==================================== Responsive ============================== */
@media (max-width: 768.98px) {
  .login {
    flex-direction: column;
    min-height: auto;
  }
  .login__heading,
  .login__description {
    display: none;
  }
  .login__panel--left,
  .login__panel--right {
    width: 100%;
    padding: 40px 20px;
  }

  .login__header {
    margin-bottom: 30px;
  }

  .theme-toggle {
    top: 25px;
    right: 25px;
    z-index: 10;
  }
}

@media (min-width: 768.98px) and (max-width: 991.98px) {
  .login {
    max-width: 700px;
  }
  .login__panel--left {
    width: 45%;
  }
  .login__panel--right {
    width: 55%;
  }
}

@media (min-width: 991.98px) and (max-width: 1219.98px) {
  .login {
    max-width: 850px;
  }
  .login__panel--left {
    width: 47%;
  }
  .login__panel--right {
    width: 53%;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 1;
}
::view-transition-new(root) {
  z-index: 2;
}


/* Overlay */
.hn-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: hnFadeIn 0.25s ease both;
}

.hn-overlay--hidden {
    display: none !important;
}

@keyframes hnFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal box */
.hn-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.22),
        0 4px 16px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: hnSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transform-origin: center bottom;
}

body.dark-mode .hn-modal {
    background: #1e293b;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

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

/* Exit animation */
.hn-modal--exit {
    animation: hnSlideDown 0.28s ease forwards;
}

@keyframes hnSlideDown {
    from { opacity: 1; transform: translateY(0)    scale(1);    }
    to   { opacity: 0; transform: translateY(24px) scale(0.96); }
}

/* Header */
.hn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, #166534 0%, #16a34a 50%, #15803d 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.hn-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}

.hn-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.hn-header__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.hn-header__title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    letter-spacing: 0.01em;
}

.hn-close {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s, transform 0.15s;
    flex-shrink: 0;
}

.hn-close:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #fff;
    transform: scale(1.08);
}

.hn-close:active { transform: scale(0.95); }

/* Body */
.hn-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

body.dark-mode .hn-body { scrollbar-color: #334155 transparent; }

.hn-body::-webkit-scrollbar { width: 5px; }
.hn-body::-webkit-scrollbar-track { background: transparent; }
.hn-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
body.dark-mode .hn-body::-webkit-scrollbar-thumb { background: #334155; }

/* Rich text content */
.hn-content {
    font-size: 14px;
    line-height: 1.75;
    color: #374151;
}
body.dark-mode .hn-content { color: #cbd5e1; }
.hn-content p { margin-bottom: 10px; }
.hn-content strong, .hn-content b { font-weight: 700; color: #111827; }
body.dark-mode .hn-content strong,
body.dark-mode .hn-content b { color: #f1f5f9; }
.hn-content em, .hn-content i { font-style: italic; }
.hn-content a { color: #16a34a; text-decoration: underline; }
.hn-content a:hover { color: #15803d; }
.hn-content ul, .hn-content ol { padding-left: 20px; margin-bottom: 10px; }
.hn-content li { margin-bottom: 4px; }
.hn-content h1, .hn-content h2, .hn-content h3, .hn-content h4 {
    font-weight: 700; margin-bottom: 8px;
    color: #111827; line-height: 1.35;
}
body.dark-mode .hn-content h1,
body.dark-mode .hn-content h2,
body.dark-mode .hn-content h3,
body.dark-mode .hn-content h4 { color: #f1f5f9; }
.hn-content h1 { font-size: 20px; }
.hn-content h2 { font-size: 17px; }
.hn-content h3 { font-size: 15px; }
.hn-content img { max-width: 100%; border-radius: 8px; }
.hn-content blockquote {
    border-left: 3px solid #16a34a;
    padding-left: 12px;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 10px;
}
.hn-content table { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 13px; }
.hn-content th, .hn-content td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: left; }
body.dark-mode .hn-content th,
body.dark-mode .hn-content td { border-color: #334155; }
.hn-content th { background: #f3f4f6; font-weight: 600; }
body.dark-mode .hn-content th { background: #0f172a; }

/* Footer */
.hn-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    flex-wrap: wrap;
}
body.dark-mode .hn-footer { border-top-color: #2d3748; }

/* Buttons */
.hn-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    line-height: 1;
    white-space: nowrap;
}
.hn-btn:active { transform: scale(0.97); }

/* Ghost button */
.hn-btn--ghost {
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
}
body.dark-mode .hn-btn--ghost { color: #94a3b8; border-color: #334155; }
.hn-btn--ghost:hover { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
body.dark-mode .hn-btn--ghost:hover { background: #0f172a; color: #cbd5e1; }

/* Primary button */
.hn-btn--primary {
    background: linear-gradient(135deg, #166534 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}
.hn-btn--primary:hover {
    background: linear-gradient(135deg, #15803d 0%, #14532d 100%);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

/* Responsive mobile — bottom sheet */
@media (max-width: 480px) {
    .hn-overlay { align-items: flex-end; padding: 0; }
    .hn-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        animation: hnSheetUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1) both;
    }
    @keyframes hnSheetUp {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .hn-footer { flex-direction: column-reverse; align-items: stretch; }
    .hn-btn { justify-content: center; width: 100%; padding: 11px 18px; }
}

/* Admin — notification editor preview box */
.notif-preview-box {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    background: #f9fafb;
}
.notif-preview-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.notif-preview-content {
    font-size: 13px;
    line-height: 1.65;
    color: #374151;
}
