/* =============================================================================
   EMDR Remote v2 — Patient Stylesheet
   Estetica: immersiva, calma, focus assoluto sulla stimolazione
   ============================================================================= */

:root {
  --navy: #0B1C3D;
  --navy-deep: #061128;
  --gold: #C9A84C;
  --gold-pale: #E8D89A;
  --paper: #F8F6F1;
  --ink: #1B1B1B;
  --rule: rgba(255, 255, 255, 0.15);

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Jost', sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  background: var(--navy-deep);
  color: var(--paper);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.6s ease-out;
}

.screen--active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==================== ENTRY ==================== */
#screen-entry {
  background:
    radial-gradient(ellipse at top, rgba(201, 168, 76, 0.12), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(11, 28, 61, 0.6), var(--navy-deep) 70%),
    var(--navy-deep);
}

.entry-content {
  text-align: center;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.brand-mini {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--paper);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-mini em {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--paper);
  letter-spacing: -0.01em;
}

.welcome-subtitle {
  color: var(--gold-pale);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
}

.code-input-group {
  width: 100%;
  margin: 16px 0;
}

#codeInput {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 24px;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
  transition: all 0.2s;
}

#codeInput:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.18);
}

#codeInput::placeholder {
  color: rgba(232, 216, 154, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 32px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease-out;
}

.btn--connect {
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  width: 100%;
  font-size: 1.05rem;
}

.btn--connect:hover {
  background: var(--gold-pale);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.3);
}

.btn--connect:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.entry-note {
  font-size: 0.78rem;
  color: rgba(232, 216, 154, 0.5);
  font-style: italic;
}

/* ==================== WAITING ==================== */
#screen-waiting {
  background:
    radial-gradient(ellipse at center, rgba(201, 168, 76, 0.08), transparent 60%),
    var(--navy-deep);
}

.waiting-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.waiting-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold), var(--gold-pale) 60%, transparent);
  box-shadow: 0 0 60px rgba(201, 168, 76, 0.4);
  animation: orbPulse 3s ease-in-out infinite;
  margin-bottom: 16px;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 1; }
}

.waiting-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--paper);
}

.waiting-text {
  color: var(--gold-pale);
  font-style: italic;
  font-size: 1rem;
}

/* ==================== BLS STAGE (cuore della stimolazione) ==================== */
.screen--bls {
  background: #050A14; /* nero quasi puro per ridurre stimoli laterali */
  flex-direction: column;
}

.bls-stage {
  position: relative;
  width: 90vw;
  height: 60vh;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.bls-ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, var(--gold) 50%, var(--gold-pale) 100%);
  box-shadow:
    0 0 30px rgba(255, 255, 255, 0.5),
    0 0 60px rgba(201, 168, 76, 0.4);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(0, -50%);
  /* L'animazione è applicata via JS con CSS animation dinamica */
}

.bls-ball.bls-active {
  animation-name: blsMove;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

@keyframes blsMove {
  from { left: 0; transform: translate(0, -50%); }
  to { left: calc(100% - 60px); transform: translate(0, -50%); }
}

.bls-counter {
  position: absolute;
  bottom: 32px;
  right: 32px;
  font-family: var(--font-display);
  font-size: 3rem;
  color: rgba(201, 168, 76, 0.4);
  font-weight: 500;
}

/* ==================== PAUSE ==================== */
#screen-pause {
  background:
    radial-gradient(ellipse at center, rgba(201, 168, 76, 0.06), transparent 60%),
    var(--navy-deep);
}

.pause-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 420px;
}

.pause-icon {
  font-size: 3rem;
  color: var(--gold);
  animation: orbPulse 3s ease-in-out infinite;
}

.pause-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  font-style: italic;
  color: var(--paper);
}

.pause-text {
  color: var(--gold-pale);
  font-size: 0.95rem;
  font-weight: 300;
  margin-bottom: 16px;
}

.btn--patient-signal {
  background: rgba(160, 57, 43, 0.15);
  color: #E8B0A0;
  border: 1px solid #A0392B;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.btn--patient-signal:hover {
  background: #A0392B;
  color: white;
}

/* ==================== END ==================== */
#screen-end {
  background: var(--navy-deep);
}

.end-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.end-mark {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-pale));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--navy);
  box-shadow: 0 8px 32px rgba(201, 168, 76, 0.3);
}

.end-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--paper);
}

.end-text {
  color: var(--gold-pale);
  font-style: italic;
}
