/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #e8384f;
  --red-hover: #d42e43;
  --dark: #1a1a2e;
  --gray-900: #2d2d44;
  --gray-600: #6b7280;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --shadow: 0 8px 40px rgba(0,0,0,.08);
  --radius: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--dark);
  min-height: 100vh;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header ===== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
}
.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: .625rem;
}
.logo-icon { flex-shrink: 0; }
.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: -.25px;
}
.header-info {
  font-size: .8125rem;
  color: var(--gray-600);
  display: none;
}
@media (min-width: 640px) {
  .header-info { display: block; }
}

/* ===== Main / Hero ===== */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(232,56,79,.06) 0%, transparent 50%),
    linear-gradient(225deg, rgba(26,26,46,.04) 0%, transparent 50%);
  z-index: 0;
}
.hero-bg::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,56,79,.06) 0%, transparent 70%);
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

/* ===== Card ===== */
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}
.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .375rem;
}
.card-subtitle {
  font-size: .875rem;
  color: var(--gray-600);
  margin-bottom: 2rem;
}

/* ===== Form ===== */
.field {
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: .375rem;
}
.field input {
  width: 100%;
  padding: .75rem 1rem;
  font-size: .9375rem;
  color: var(--dark);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(232,56,79,.1);
  background: var(--white);
}
.field input::placeholder {
  color: var(--gray-400);
}

/* ===== Primary Button ===== */
.btn-primary {
  width: 100%;
  padding: .875rem;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .75px;
  color: var(--white);
  background: var(--red);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background .15s, transform .1s;
  margin-top: .5rem;
}
.btn-primary:hover:not(:disabled) {
  background: var(--red-hover);
}
.btn-primary:active:not(:disabled) {
  transform: scale(.985);
}
.btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.btn-arrow {
  transition: transform .15s;
}
.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

/* Spinner */
.btn-loader {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Outline Button ===== */
.btn-outline {
  margin-top: 1rem;
  width: 100%;
  padding: .625rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--gray-600);
  background: transparent;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ===== Error box ===== */
.error-box {
  margin-top: 1.25rem;
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--red);
  background: rgba(232,56,79,.06);
  border: 1px solid rgba(232,56,79,.18);
  border-radius: 10px;
  text-align: center;
}

/* ===== Utility ===== */
.hidden { display: none !important; }

/* ===== Server picker ===== */
.server-picker {
  margin-top: .5rem;
}
.picker-title {
  font-size: .875rem;
  color: var(--gray-600);
  text-align: center;
  margin-bottom: 1rem;
}
.server-list {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.server-btn {
  width: 100%;
  padding: .875rem 1rem;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--dark);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.server-btn:hover {
  border-color: var(--red);
  background: var(--white);
  box-shadow: 0 2px 12px rgba(232,56,79,.08);
}
.server-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.server-btn .srv-name {
  display: block;
  color: var(--red);
  font-weight: 600;
}
.server-btn .srv-url {
  display: block;
  font-size: .75rem;
  color: var(--gray-400);
  margin-top: .25rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1.25rem;
  font-size: .75rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}
