/* ============================================================
   FORMS — Shared form page styles
   ============================================================ */

.logo-bg { color: var(--color-primary); }
.logo-dot { color: var(--color-accent); }

.form-section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}

/* Layout: sidebar + form */
.form-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (max-width: 860px) {
  .form-layout {
    grid-template-columns: 1fr;
  }
  .form-sidebar { order: 2; }
  .form-wrapper { order: 1; }
}

/* ── Sidebar ── */
.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(64px + var(--space-6));
}

.sidebar-heading {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.expect-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.expect-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  max-width: none;
}

.expect-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.expect-list strong {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  display: block;
  margin-bottom: var(--space-1);
}

.expect-list p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: none;
  line-height: 1.5;
}

.sidebar-contact {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider);
}

.sidebar-contact-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-1);
  max-width: none;
}

.sidebar-contact-link {
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
  word-break: break-all;
}
.sidebar-contact-link:hover {
  text-decoration: underline;
}

/* ── Form Wrapper ── */
.form-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) clamp(var(--space-6), 4vw, var(--space-10));
  box-shadow: var(--shadow-sm);
}

/* ── Fieldsets ── */
fieldset {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-8);
}

.fieldset-legend {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-5);
  width: 100%;
  display: block;
}

/* ── Honeypot ── */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Submit Area ── */
.form-submit-area {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.submit-btn {
  align-self: flex-start;
  position: relative;
  min-width: 220px;
}

.submit-btn.loading .btn-label { opacity: 0; }
.submit-btn.loading .btn-spinner { display: block; }

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.form-privacy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.5;
  max-width: 56ch;
}

/* ── Support Portal Specific ── */
.auth-panel {
  max-width: 440px;
  margin-inline: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.auth-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 34ch;
  margin-inline: auto;
  line-height: 1.5;
}

.auth-toggle {
  text-align: center;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.auth-toggle a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}
.auth-toggle a:hover { text-decoration: underline; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-4);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

/* Ticket table */
.ticket-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.ticket-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
}

.ticket-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
}

.ticket-table tr:last-child td { border-bottom: none; }
.ticket-table tr:hover td { background: var(--color-surface-2); }

.ticket-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.status-open {
  background: rgba(47,126,184,0.12);
  color: var(--color-accent);
}

.status-in-progress {
  background: rgba(209,153,0,0.12);
  color: var(--color-warning);
}

.status-resolved {
  background: rgba(45,125,70,0.12);
  color: var(--color-success);
}

.status-closed {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}

/* Ticket priority */
.priority-low    { color: var(--color-text-muted); }
.priority-normal { color: var(--color-accent); }
.priority-high   { color: var(--color-warning); }
.priority-urgent { color: var(--color-error); font-weight: 700; }

/* Support page layout */
.support-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 860px) {
  .support-layout {
    grid-template-columns: 1fr;
  }
}

.support-sidebar {
  position: sticky;
  top: calc(64px + var(--space-4));
}

.user-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  text-align: center;
  margin-bottom: var(--space-4);
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 400;
  font-family: var(--font-display);
  margin: 0 auto var(--space-3);
}

.user-name {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text);
}

.user-email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  word-break: break-all;
}

.support-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.support-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-divider);
  transition: all var(--transition-fast);
}

.support-nav li:last-child a { border-bottom: none; }

.support-nav a:hover, .support-nav a.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.support-main {
  min-width: 0;
}

.support-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-3);
  flex-wrap: wrap;
}

.support-toolbar h2 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: none;
}

/* Modal / Dialog */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  margin: var(--space-4);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}
