/* ===== Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #2d3748;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* ===== Layout ===== */
.center-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px 32px;
  width: 100%;
  animation: slideUp 0.4s ease-out;
}

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

/* ===== Brand Section ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  text-align: left;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #2d3748;
}

.brand-text p {
  font-size: 13px;
  color: #718096;
  font-weight: 500;
}

/* ===== Form Styles ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  color: #4a5568;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #2d3748;
  transition: all 0.2s ease;
  background: #f7fafc;
}

.input:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input::placeholder {
  color: #a0aec0;
}

/* ===== Actions ===== */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn, .secondary {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary {
  background: #f0f4f8;
  color: #2d3748;
  border: 2px solid #e2e8f0;
  text-decoration: none;
}

.secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e0;
}

.secondary:active {
  background: #cbd5e0;
}

/* ===== Messages ===== */
#message-container {
  margin-bottom: 20px;
}

.message {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
  display: none !important;
}

.message.success {
  background: #f0fdf4;
  color: #166534;
  border-left: 4px solid #22c55e;
  display: block !important;
}

.message.error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
  display: block !important;
}

.message.info {
  background: #eff6ff;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
  display: block !important;
}

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

/* ===== Small Note ===== */
.small-note {
  text-align: center;
  font-size: 12px;
  color: #a0aec0;
  margin-top: 16px;
}

/* ===== Loading State ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ===== Links ===== */
a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .card {
    padding: 32px 20px;
  }

  .brand {
    gap: 12px;
    margin-bottom: 24px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .brand-text h1 {
    font-size: 20px;
  }

  .input {
    padding: 10px 14px;
    font-size: 16px;
  }

  .btn, .secondary {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 40px;
  }

  .actions {
    flex-direction: column;
  }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
  body {
    color: #e2e8f0;
  }

  .card {
    background: #1a202c;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }

  .brand-text h1 {
    color: #f7fafc;
  }

  .brand-text p {
    color: #a0aec0;
  }

  .input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .input:focus {
    border-color: #9f7aea;
    background: #1a202c;
  }

  .input::placeholder {
    color: #718096;
  }

  .secondary {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
  }

  .secondary:hover {
    background: #4a5568;
    border-color: #718096;
  }

  .small-note {
    color: #718096;
  }
}
