/* House of Love — Participant Page */

:root {
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --input-bg: #ffffff;
  --input-border: #e0e0e0;
  --btn-bg: #1a1a1a;
  --btn-bg-disabled: #b0b0b0;
  --btn-fg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #888888;
  --text-success: #2e7d32;
  --text-error: #c62828;
  --radius-card: 20px;
  --radius-input: 16px;
  --radius-btn: 50%;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-input: 0 1px 4px rgba(0, 0, 0, 0.04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 480px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.header {
  text-align: center;
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Input area — embedded button pattern */
.input-wrapper {
  position: relative;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-input);
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: #aaa;
}

.input-wrapper textarea {
  width: 100%;
  min-height: 80px;
  max-height: 160px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  padding: 14px 56px 14px 16px;
  color: var(--text-primary);
}

.input-wrapper textarea::placeholder {
  color: var(--text-secondary);
}

/* Send button — inside the textarea */
.btn-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-btn);
  border: none;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.05);
}

.btn-send:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-send:disabled {
  background: var(--btn-bg-disabled);
  cursor: not-allowed;
}

.btn-send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Spinner on send button */
.btn-send .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-send.loading .icon-arrow {
  display: none;
}

.btn-send.loading .spinner {
  display: block;
}

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

/* Footer: counter + feedback */
.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  min-height: 24px;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.char-count.warn {
  color: var(--text-error);
}

.feedback {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
}

.feedback.visible {
  opacity: 1;
}

.feedback.success {
  color: var(--text-success);
}

.feedback.error {
  color: var(--text-error);
}

.feedback.cooldown {
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 360px) {
  .card {
    padding: 24px 16px;
  }
}
