/* ===== RESET Y ESTILOS BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #00a1e0;
  --primary-dark: #0079b8;
  --secondary: #2e7d32;
  --secondary-dark: #1b5e20;
  --danger: #e53935;
  --danger-dark: #c62828;
  --dark-bg: #121212;
  --dark-card: #1e1e1e;
  --dark-card-hover: #252525;
  --dark-text: #e0e0e0;
  --dark-text-secondary: #9e9e9e;
  --border-dark: #333333;
  --shadow-dark: rgba(0, 0, 0, 0.5);
  --success: #4caf50;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark-bg);
  color: var(--dark-text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  transition: all 0.3s ease;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== ENCABEZADO ===== */
h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--dark-text);
  font-size: 2.2rem;
  font-weight: 600;
}

h1 i {
  color: var(--primary);
  margin-right: 15px;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.app-container {
  display: flex;
  gap: 30px;
  min-height: 500px;
  position: relative;
}

/* ===== TARJETA DE LOGIN ===== */
.card {
  background: var(--dark-card);
  border-radius: 12px;
  box-shadow: 0 8px 30px var(--shadow-dark);
  border: 1px solid var(--border-dark);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 10px 40px rgba(0, 161, 224, 0.15);
}

.login-card {
  flex: 1;
  padding: 30px;
  max-width: 500px;
  margin: 0 auto;
}

.card-header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-dark);
}

.card-header h2 {
  font-size: 1.5rem;
  color: var(--dark-text);
  font-weight: 500;
}

.card-header i {
  color: var(--primary);
  margin-right: 10px;
}

/* ===== FORMULARIOS ===== */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark-text-secondary);
}

label i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

textarea, input {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-dark);
  background: #2a2a2a;
  color: var(--dark-text);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  transition: all 0.2s;
}

textarea:focus, input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 161, 224, 0.2);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

textarea#output {
  min-height: 350px;
  font-size: 13px;
  line-height: 1.5;
}

/* ===== BOTONES ===== */
button {
  padding: 14px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-login {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-login:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-generate {
  background: var(--secondary);
  color: white;
  width: 100%;
}

.btn-generate:hover:not(:disabled) {
  background: var(--secondary-dark);
}

.btn-action {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-download {
  background: var(--primary);
  color: white;
}

.btn-download:hover {
  background: var(--primary-dark);
}

.btn-copy {
  background: var(--secondary);
  color: white;
}

.btn-copy:hover {
  background: var(--secondary-dark);
}

/* ===== PANELES ===== */
.loading-panel, .result-panel {
  flex: 1;
  background: var(--dark-card);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 8px 30px var(--shadow-dark);
  border: 1px solid var(--border-dark);
  opacity: 1;
  transform: translateY(0);
}

.loading-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-container {
  text-align: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(0, 161, 224, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-container p {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--dark-text);
}

.loading-subtext {
  font-size: 14px !important;
  color: var(--dark-text-secondary) !important;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-dark);
}

.result-header h2 {
  font-size: 1.5rem;
  color: var(--dark-text);
  font-weight: 500;
}

.result-header i {
  color: var(--primary);
  margin-right: 10px;
}

.action-buttons {
  display: flex;
  gap: 15px;
}

.code-container {
  position: relative;
}

.code-info {
  margin-top: 10px;
  font-size: 13px;
  color: var(--dark-text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-info i {
  color: var(--primary);
}

/* ===== ESTADOS Y MENSAJES ===== */
.status-message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-message:empty {
  display: none;
}

.divider {
  margin: 25px 0;
  border: none;
  border-top: 1px solid var(--border-dark);
}

/* ===== UTILIDADES ===== */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ===== PIE DE PÁGINA ===== */
.footer {
  margin-top: 40px;
  text-align: center;
  color: var(--dark-text-secondary);
  font-size: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dark);
}

.footer i {
  color: var(--primary);
  margin-right: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .login-card, .loading-panel, .result-panel {
    max-width: 100%;
  }
  
  .result-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .action-buttons {
    width: 100%;
  }
  
  .btn-action {
    flex: 1;
  }
  
  h1 {
    font-size: 1.8rem;
  }
}