:root {
  --primary: #734bff;
  --secondary: #00c6fb;
  --background: #f6f8ff;
  --glass-bg: rgba(255,255,255,0.85);
  --border-radius: 26px;
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
  --accent: #ffe082;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(120deg, var(--primary) 0%, var(--secondary) 100%);
  min-height: 100vh;
  font-family: 'Poppins', Arial, sans-serif;
  color: #1a1932;
  box-sizing: border-box;
  letter-spacing: 0.01em;
}

.main-container {
  max-width: 500px;
  margin: 60px auto 30px auto;
  padding: 38px 24px 36px 24px;
  background: var(--glass-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  text-align: center;
  margin-bottom: 38px;
}

.title {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary) 40%, var(--secondary) 70%);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1.18rem;
  color: #495178;
  font-weight: 400;
}

.glass-form {
  width: 100%;
  background: rgba(255,255,255,0.50);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 18px rgba(31, 38, 135, 0.10);
  padding: 20px 18px 16px 18px;
  margin-bottom: 22px;
  backdrop-filter: blur(7px);
  border: 1.7px solid rgba(127,127,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.button-row {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.action-btn {
  flex: 1 1 0;
  background: linear-gradient(90deg, #734bff, #00c6fb 95%);
  color: #fff;
  border: none;
  border-radius: 15px;
  padding: 13px 0;
  font-size: 1.13rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(111, 71, 235, 0.10);
  transition: filter 0.2s, transform 0.14s;
  letter-spacing: 0.01em;
}
.action-btn:active {
  filter: brightness(0.87);
  transform: scale(0.97);
}

#prompt {
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  font-size: 1.18rem;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1.8px solid #e5e7fb;
  outline: none;
  background: rgba(255,255,255,0.96);
  transition: border-color 0.2s;
  font-family: inherit;
  font-weight: 500;
  box-shadow: 0 1px 8px rgba(127,127,255,0.04);
  margin-bottom: 9px;
  resize: vertical;
  box-sizing: border-box;  /* <-- ¡esto es importante! */
}

}
#prompt:focus {
  border-color: #734bff;
}

.suggested-prompt {
  display: none;
  font-size: 1.05rem;
  background: #f7f8fd;
  color: #312972;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  margin-top: 0;
  box-shadow: 0 1px 7px rgba(111,71,235,0.07);
  border: 1.3px solid #e6e2fa;
  cursor: pointer;
  transition: background 0.18s;
}
.suggested-prompt.active {
  display: block;
}
.suggested-prompt svg {
  vertical-align: middle;
}
.suggested-prompt span {
  font-size: 0.96em;
  color: #888;
  margin-left: 8px;
}
.suggested-prompt:hover {
  background: #ede8fd;
}

.loading {
  margin: 18px 0 0 0;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 1.17rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loader {
  width: 36px;
  height: 36px;
  border: 4px solid #ece9fe;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.95s linear infinite;
  margin-bottom: 3px;
}
@keyframes spin {
  100% { transform: rotate(360deg);}
}

.result {
  margin-top: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.generated-image-container {
  width: 100%;
  max-width: 420px;
  margin: auto;
  background: rgba(255,255,255,0.88);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  border: 1.6px solid #f1eefa;
  margin-bottom: 18px;
  animation: fadeIn 0.85s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.93);}
  to { opacity: 1; transform: scale(1);}
}

.generated-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 6px 22px rgba(111, 71, 235, 0.11);
  border: 1.5px solid #eee;
  background: #fff;
  display: block;
}

.image-actions {
  display: flex;
  gap: 19px;
  margin-top: 12px;
}

footer {
  text-align: center;
  margin: 28px 0 16px 0;
  color: #fff;
  opacity: 0.93;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.info-ai {
  background: linear-gradient(90deg,#e6e8fd 60%,#f6f8ff 100%);
  color: #484899;
  font-size: 1.05rem;
  font-weight: 500;
  border-radius: 13px;
  padding: 8px 14px 7px 14px;
  margin-bottom: 10px;
  margin-top: 0;
  box-shadow: 0 1px 7px rgba(127,127,255,0.07);
  display: inline-block;
}

/* Responsive para mobile */
@media (max-width: 600px) {
  .main-container {
    max-width: 99vw;
    padding: 14vw 2vw 12vw 2vw;
    margin: 10px 1vw 24px 1vw;
  }
  .glass-form {
    padding: 11px 4vw 13px 4vw;
  }
  .button-row {
    flex-direction: column;
    gap: 11px;
  }
  .generated-image-container {
    max-width: 99vw;
    padding: 4vw 2vw 6vw 2vw;
  }
  .title { font-size: 2rem;}
}

.remaining-msg {
  font-size: 1.01rem;
  margin-bottom: 5px;
  margin-top: 4px;
  min-height: 22px;
  transition: color 0.2s;
}
