/* Chiarina foto.css v2 — Foto-Modul Step 4 Frontend
   Generated: 2026-05-11
   Styles für: Foto-Button (unter Status), Sheet (Kamera/Galerie),
   Crop-Modal (Canvas mit 4 Ecken-Handles), Toast.
   Mobile-first, max-width 480px, nutzt Tokens aus style.css.
   Keine Animationen, keine Transitions (Chiarina-Konvention).

   v2 Diff zu v1 (beide Fixes am 11.05.2026):
     - .foto-modal/.foto-toast/.foto-sheet-backdrop respektieren jetzt
       hidden-Attribut (display:flex/fixed schlug User-Agent-default).
     - .foto-modal__canvas-wrap hat 24px Padding links/rechts, damit
       die 4 Eck-Handles nicht in der Browser-Swipe-Zone des Handys
       sitzen (sonst löst Drag ein Tab-Back/Forward aus).
*/

/* ---------------------------------------------------------------------------
   Foto-Button — unter Status-Bereich, abgesetzt aber sichtbar
--------------------------------------------------------------------------- */
.foto-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px auto 0 auto;
  padding: 14px 24px;
  min-height: 56px;
  min-width: 200px;
  background: var(--color-waiting);
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.foto-btn[disabled],
.foto-btn[data-enabled="false"] {
  background: var(--color-disabled);
  cursor: not-allowed;
}

.foto-btn__icon {
  font-size: 22px;
  line-height: 1;
}

.foto-btn__label {
  line-height: 1;
}

/* ---------------------------------------------------------------------------
   Sheet — Quellen-Auswahl (Kamera/Galerie/Abbrechen)
--------------------------------------------------------------------------- */
.foto-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.foto-sheet-backdrop[hidden] {
  display: none;
}

.foto-sheet {
  width: 100%;
  max-width: var(--max-w);
  background: var(--color-header);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foto-sheet__title {
  margin: 4px 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  letter-spacing: 0.02em;
}

.foto-sheet__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.foto-sheet__btn--cancel {
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  justify-content: center;
  font-weight: 500;
  margin-top: 4px;
}

.foto-sheet__icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Modal — Crop-View (fullscreen)
--------------------------------------------------------------------------- */
.foto-modal {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

/* hidden-Attribut muss display:none erzwingen, sonst schlägt display:flex */
.foto-modal[hidden] {
  display: none;
}

.foto-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px calc(12px + env(safe-area-inset-top, 0px)) 16px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
}

.foto-modal__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.foto-modal__hint {
  font-size: 12px;
  font-weight: 400;
  color: #aaaaaa;
}

.foto-modal__canvas-wrap {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  touch-action: none;
  /* Sicherheitsabstand: 4 Ecken-Handles dürfen nicht in der
     Browser-Swipe-Zone (links/rechts) liegen, sonst löst Drag
     einen Tab-Back/Forward aus. */
  padding: 0 24px;
}

.foto-modal__canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}

.foto-modal__actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
  background: rgba(0, 0, 0, 0.92);
}

.foto-modal__btn {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.foto-modal__btn--primary {
  background: var(--color-idle);
  color: #ffffff;
}

.foto-modal__btn--secondary {
  background: #444444;
  color: #ffffff;
}

.foto-modal__btn--cancel {
  background: transparent;
  color: #cccccc;
  font-weight: 500;
}

.foto-modal__btn[disabled] {
  background: var(--color-disabled);
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Upload-Overlay (während POST /api/foto läuft)
--------------------------------------------------------------------------- */
.foto-modal__busy {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  z-index: 10;
}

/* ---------------------------------------------------------------------------
   Toast — Erfolg/Fehler-Meldung nach Upload
--------------------------------------------------------------------------- */
.foto-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: calc(var(--max-w) - 32px);
  padding: 12px 20px;
  background: var(--color-text);
  color: #ffffff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.foto-toast[hidden] {
  display: none;
}

.foto-toast--error {
  background: var(--color-recording);
}

.foto-toast--success {
  background: var(--color-idle);
}
