/* === Tips Page & Embedded Tips Form === */

/* Local vars used by form component styles below.
   On the standalone tips page, .tips-page provides them.
   On index.html, #tips-section maps them from main.css vars. */
.tips-page {
  --bg: #0a0a14;
  --surface: #111122;
  --paper: #c4b89e;
  --paper-light: #d0c4a8;
  --ink: #1a1a18;
  --ink-light: #3a3a35;
  --red: #c9302c;
  --muted: #7a7a8a;
  --text: #e8e6e3;

  max-width: min(860px, 90vw);
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
}

#tips-section {
  --surface: var(--bg-surface, #111122);
  --paper: #c4b89e;
  --paper-light: #d0c4a8;
  --ink: #1a1a18;
  --ink-light: #3a3a35;
  --red: var(--red-thread, #c9302c);
  --muted: var(--text-muted, #7a7a8a);
  --text: var(--text-primary, #e8e6e3);
}

/* Header */
.tips-header {
  margin-bottom: 2.5rem;
}

.tips-back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.tips-back:hover {
  color: var(--text);
}

.tips-header h1 {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--paper-light);
}

.tips-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Form */
.tips-form {
  position: relative;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.optional {
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
}

/* Textarea — aged paper feel */
.tips-form textarea {
  width: 100%;
  padding: 1.8rem 2rem;
  background: linear-gradient(168deg, var(--paper) 0%, #b8ab8f 40%, #ada07e 100%);
  border: 1px solid rgba(160, 140, 100, 0.3);
  border-radius: 2px;
  color: var(--ink);
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.1rem;
  line-height: 1.85;
  resize: vertical;
  min-height: 340px;
  outline: none;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 250, 240, 0.3);
  transition: box-shadow 0.3s;
}

.tips-form textarea::placeholder {
  color: var(--ink-light);
  opacity: 0.5;
}

.tips-form textarea:focus {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.15),
    0 0 0 2px rgba(201, 48, 44, 0.5),
    inset 0 1px 0 rgba(255, 250, 240, 0.3);
}

.tips-form textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.char-count {
  text-align: right;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.3rem;
  font-family: 'Lexend', sans-serif;
}

/* Contact inputs */
.form-group-optional {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group-optional input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Lexend', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
}

.form-group-optional input::placeholder {
  color: var(--muted);
}

.form-group-optional input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

.form-group-optional input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

/* Submit */
.form-actions {
  margin-top: 2rem;
}

.tips-submit {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: 'Lexend', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.tips-submit:hover:not(:disabled) {
  background: #d9403c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 48, 44, 0.3);
}

.tips-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Notice */
.tips-notice {
  margin-top: 1.5rem;
  padding: 1rem;
  border-left: 2px solid rgba(255, 255, 255, 0.06);
}

.tips-notice p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Status messages */
.tips-status {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  display: none;
}

.tips-status.success {
  display: block;
  background: rgba(40, 120, 60, 0.15);
  border: 1px solid rgba(40, 120, 60, 0.3);
  color: #8fc9a0;
}

.tips-status.error {
  display: block;
  background: rgba(201, 48, 44, 0.1);
  border: 1px solid rgba(201, 48, 44, 0.3);
  color: #e8a0a0;
}

/* Responsive */
@media (max-width: 768px) {
  .tips-page {
    padding: 2rem 1rem 3rem;
  }

  .tips-header h1 {
    font-size: 1.4rem;
  }
}
