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

:root {
  --primary: #003366;
  --primary-dark: #002244;
  --primary-light: #004488;
  --secondary: #0066cc;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  min-height: 100vh;
  color: var(--gray-800);
  line-height: 1.6;
}

/* Header */
.header {
  background: var(--primary);
  color: var(--white);
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Main sections */
.login-section,
.form-section,
.result-section {
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 140px);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
}

.login-card {
  max-width: 400px;
}

.form-card {
  max-width: 800px;
}

.result-card {
  max-width: 600px;
  text-align: center;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
}

.card-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

/* Forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fieldset {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 0.5rem;
}

.fieldset legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0 0.5rem;
  font-size: 0.95rem;
}

.fieldset legend svg {
  width: 18px;
  height: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: var(--error);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-submit {
  margin-top: 1rem;
}

/* Error/Success messages */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.success-message {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--success);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.attempts-info {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Result section */
.result-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
}

.result-icon.success {
  color: var(--success);
}

.result-icon.error {
  color: var(--error);
}

.result-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.result-message {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.result-url {
  display: block;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
  word-break: break-all;
}

.result-url a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
}

.result-url a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  background: var(--gray-800);
  color: var(--gray-400);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
}

/* Loading spinner */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Type selection grid */
.type-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.type-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-800);
  text-align: left;
}

.type-btn:hover {
  border-color: var(--secondary);
  background: var(--gray-50);
  box-shadow: var(--shadow-sm);
}

.type-btn svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .card {
    padding: 1.5rem;
  }

  .fieldset {
    padding: 1rem;
  }
}
