@import '../components/notifications.css';
@import '../components/tooltips.css';

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

:root {
  color-scheme: light;
}

body {
  font-family: var(--font-family-primary, 'Space Grotesk', sans-serif);
  color: #0f172a;
  min-height: 100vh;
  background: #ffffff;
}

.login-page {
  min-height: 100vh;
  width: 100%;
}

.login-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-showcase {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background: #e5e7eb;
}

.login-showcase-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px;
  background: #ffffff;
}

.login-card {
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.login-header {
  margin-bottom: 36px;
  text-align: center;
}

.login-logo {
  display: block;
  width: min(100%, 260px);
  height: auto;
  margin: 0 auto 28px;
  object-fit: contain;
}

.login-header h1 {
  font-size: clamp(34px, 3vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: #0f172a;
}

.login-header p {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.65;
  color: #64748b;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  transition: color 0.2s ease;
  pointer-events: none;
}

.form-group input {
  width: 100%;
  height: 60px;
  padding: 16px 18px 16px 54px;
  border-radius: 18px;
  border: 1px solid #d7dee8;
  background: #ffffff;
  color: #0f172a;
  font-size: 16px;
  font-family: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

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

.form-group input:hover {
  border-color: #bfcada;
}

.form-group input:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(227, 6, 19, 0.48);
  box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.08);
}

.input-with-icon:focus-within i {
  color: #e30613;
}

.remember-forgot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 28px;
  font-size: 13px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #334155;
}

.remember-me input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.remember-me input:checked {
  background: #e30613;
  border-color: #e30613;
}

.remember-me input:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.remember-me label {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: #475569;
  cursor: pointer;
}

.forgot-password {
  color: #334155;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: #e30613;
}

.login-button {
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: 18px;
  background: #111827;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

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

.login-button:disabled {
  cursor: not-allowed;
}

.login-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.login-footer a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.login-footer a:hover {
  color: #e30613;
  text-decoration: underline;
}

.error-message {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
  font-size: 13px;
  font-weight: 700;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card {
  animation: fadeInUp 0.55s ease both;
}

.login-button.is-submitting {
  opacity: 0.88;
  pointer-events: none;
}

.login-button.is-success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 18px 34px rgba(16, 185, 129, 0.18);
  pointer-events: none;
}

.error-message.is-visible {
  display: flex;
}

@media (max-width: 1180px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-showcase {
    min-height: 42vh;
  }

  .login-panel {
    min-height: auto;
    padding: 40px 24px;
  }
}

@media (max-width: 768px) {
  .login-showcase {
    min-height: 34vh;
  }

  .login-card {
    width: 100%;
  }

  .remember-forgot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .login-showcase {
    min-height: 28vh;
  }

  .login-panel {
    padding: 28px 18px;
  }

  .login-card {
    width: 100%;
  }

  .login-header h1 {
    font-size: 28px;
  }
}
