:root {
  --primary-gradient: linear-gradient(90deg, #c8007e 0%, #00a3e0 100%);
  --primary-color: #c8007e;
  --secondary-color: #00a3e0;
  --bg-dark: #0a1128;
  --bg-light: #f7f9fa;
  --text-dark: #181c2a;
  --text-light: #fff;
  --border-radius: 1.2rem;
  --label-strong: #c8007e;
  --label-normal: #222;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
header {
  background: var(--bg-dark);
  padding: 2rem 0 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo {
  max-width: 220px;
  width: 100%;
  margin-bottom: 0.5rem;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.10));
}
h1 {
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.5rem 0 0.2rem 0;
  text-align: center;
}
p.desc {
  color: var(--text-light);
  font-size: 1.1rem;
  margin: 0 0 1.5rem 0;
  text-align: center;
  max-width: 500px;
}
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 70vh;
}
.form-container {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.08);
  padding: 2.5rem 2.2rem 2rem 2.2rem;
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.form-container::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  background: var(--primary-gradient);
  border-radius: 50%;
  opacity: 0.12;
  z-index: 0;
}
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
label {
  font-weight: 500;
  color: var(--label-normal);
  margin-bottom: 0.1rem;
  font-size: 1rem;
}
.label-strong {
  color: var(--label-strong);
  font-weight: 700;
}
input, select, textarea {
  padding: 0.8rem 1rem;
  border: 1.5px solid #e0e4ea;
  border-radius: 0.7rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border 0.2s;
  background: #f7f9fa;
  resize: none;
  margin-top: 0.1rem;
}
input:focus, select:focus, textarea:focus {
  border: 1.5px solid var(--secondary-color);
  outline: none;
  background: #fff;
}
.button-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
button {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 0.7rem;
  padding: 1rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.07);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
  width: 100%;
  position: relative;
  z-index: 1;
}
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.spinner {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 4px solid #fff;
  border-top: 4px solid #00a3e0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
  background: transparent;
  pointer-events: none;
}
.button-wrapper.loading .spinner {
  display: block;
}
.button-wrapper.loading button {
  opacity: 0.6;
}
@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
/* Barra de progreso */
.progress-section {
  display: none;
  margin-top: 0.5rem;
}
.progress-bar-track {
  width: 100%;
  height: 10px;
  background: #e0e4ea;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0;
  background: var(--primary-gradient);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-label {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.4rem;
  text-align: center;
}
/* Panel de log */
.log-section {
  display: none;
  margin-top: 0.5rem;
}
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.log-header span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--label-normal);
}
.log-clear {
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  margin: 0;
  padding: 0;
  box-shadow: none;
}
.log-box {
  background: #0a1128;
  color: #d7e3f4;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  border-radius: 0.6rem;
  padding: 0.8rem;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-line { display: block; }
.log-time { color: #6b7a99; }
.log-info    { color: #8fc7ff; }
.log-success { color: #5fe3a1; }
.log-warn    { color: #ffcc66; }
.log-error   { color: #ff7b9c; }
@media (max-width: 600px) {
  .form-container {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
  }
  h1 {
    font-size: 1.5rem;
  }
}
footer {
  background: var(--bg-dark);
  color: #fff;
  text-align: center;
  padding: 1rem 0 0.5rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
