:root {
  --neu-bg: #121217;
  --neu-surface: #121217;
  --neu-shadow-dark: #09090c;
  --neu-shadow-light: #1b1b22;
  --neu-text: #f4f4f5;
  --neu-muted: #71717a;
  --neu-accent: #38bdf8;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--neu-text);
  font-family: var(--font-system);
}

.app-viewport {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--neu-bg);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
}

.screen {
  display: none !important;
  position: absolute;
  inset: 0;
  flex-direction: column;
}

.screen.active {
  display: flex !important;
}

/* ==================== PANEL NEUMORFISMO ==================== */
.neu-settings-screen {
  background: var(--neu-bg);
  overflow-y: auto;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
}

.neu-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.neu-header {
  margin-bottom: 2px;
  padding-left: 4px;
}

.neu-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
}

.neu-header p {
  font-size: 12.5px;
  color: var(--neu-muted);
  margin-top: 3px;
}

.neu-header-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.neu-btn-back {
  background: var(--neu-surface);
  color: var(--neu-accent);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 3px 3px 6px var(--neu-shadow-dark), 
              -3px -3px 6px var(--neu-shadow-light);
}

.neu-btn-back:active {
  box-shadow: inset 2px 2px 4px var(--neu-shadow-dark), 
              inset -2px -2px 4px var(--neu-shadow-light);
}

.neu-card {
  background: var(--neu-surface);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 6px 6px 14px var(--neu-shadow-dark), 
              -6px -6px 14px var(--neu-shadow-light);
}

.neu-card.neu-card-col {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.neu-preview-container {
  padding: 12px;
  justify-content: center;
  align-items: center;
}

.preview-stage {
  width: 100%;
  max-height: 260px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #08080a;
}

.preview-stage canvas {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}

.neu-guide-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.neu-instructions-list {
  margin-top: 8px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.neu-instructions-list li {
  font-size: 12px;
  color: var(--neu-muted);
  line-height: 1.4;
}

.neu-instructions-list strong {
  color: var(--neu-accent);
}

.neu-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.neu-info strong {
  font-size: 13.5px;
  font-weight: 500;
  color: #f4f4f5;
}

.neu-info small {
  font-size: 11.5px;
  color: var(--neu-muted);
}

.neu-select-wrapper {
  background: var(--neu-surface);
  border-radius: 8px;
  padding: 4px;
  box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), 
              inset -3px -3px 6px var(--neu-shadow-light);
}

.neu-select {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--neu-text);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  cursor: pointer;
}

.neu-select option {
  background: var(--neu-bg);
  color: var(--neu-text);
}

.neu-btn-action, .neu-btn-full {
  background: var(--neu-surface);
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 4px 4px 8px var(--neu-shadow-dark), 
              -4px -4px 8px var(--neu-shadow-light);
  transition: all 0.1s ease;
}

.neu-btn-action.btn-blue, .neu-btn-full.btn-blue {
  color: #38bdf8;
}

.neu-btn-action {
  padding: 8px 14px;
}

.neu-btn-full {
  width: 100%;
  padding: 10px;
}

.neu-btn-action:active, .neu-btn-full:active {
  box-shadow: inset 2px 2px 4px var(--neu-shadow-dark), 
              inset -2px -2px 4px var(--neu-shadow-light);
}

.neu-btn-full.hidden {
  display: none;
}

.neu-separator {
  width: 100%;
  height: 1px;
  background: var(--neu-shadow-dark);
}

.neu-row-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.neu-color-well {
  background: var(--neu-surface);
  padding: 4px;
  border-radius: 8px;
  box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), 
              inset -3px -3px 6px var(--neu-shadow-light);
  display: flex;
  align-items: center;
}

.neu-color-well input[type="color"] {
  width: 32px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
}

.neu-slider-group {
  display: flex;
  flex-direction: column;
}

.neu-range {
  width: 100%;
  height: 6px;
  background: var(--neu-shadow-dark);
  border-radius: 3px;
  outline: none;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
}

.neu-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--neu-accent);
  cursor: pointer;
  box-shadow: 2px 2px 5px var(--neu-shadow-dark);
}

.neu-btn-submit.btn-green {
  width: 100%;
  height: 46px;
  background: var(--neu-surface);
  color: #4ade80;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 6px 6px 12px var(--neu-shadow-dark), 
              -6px -6px 12px var(--neu-shadow-light);
  transition: all 0.1s ease;
  margin-top: 4px;
}

.neu-btn-submit.btn-green:active {
  box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), 
              inset -3px -3px 6px var(--neu-shadow-light);
}

/* ==================== SIMULADOR MARCO TELÉFONO ==================== */
.phone-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--lock-bg, url('assets/lock_bg.png')) center/cover no-repeat;
  display: flex;
  flex-direction: column;
}

.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  padding: 10px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  z-index: 50;
  color: #fff;
}

.theme-ios .notch-island {
  width: 120px;
  height: 32px;
  background: #000;
  border-radius: 20px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 6px;
}

.theme-android .notch-island {
  width: 14px;
  height: 14px;
  background: #000;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
}

.phone-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s;
}

.phone-layer.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

/* 1. BLOQUEO */
.lock-view {
  padding-top: 56px;
  padding-bottom: 24px;
  justify-content: space-between;
  align-items: center;
}

.lock-header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-lock-icon {
  font-size: 16px;
  margin-bottom: 4px;
  opacity: 0.9;
}

.theme-ios .lock-clock-large {
  font-size: 84px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
  color: #ffffff;
}

.theme-android .lock-clock-large {
  font-size: 86px;
  font-weight: 300;
  line-height: 0.95;
  color: #f7eedf;
}

.lock-date-sub {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.lock-bottom-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.swipe-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.lock-shortcuts {
  width: 100%;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
}

.shortcut-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(25px);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
}

/* 2. TECLADO PIN */
.pin-view {
  padding: 60px 24px 30px;
  justify-content: space-between;
  background: inherit;
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
}

.theme-ios .pin-view {
  background-color: rgba(0, 0, 0, 0.35);
}

.theme-android .pin-view {
  background-color: rgba(15, 13, 19, 0.88);
}

.pin-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pin-lock-icon {
  font-size: 18px;
  margin-bottom: 8px;
}

.pin-header h2 {
  font-size: 20px;
  font-weight: 400;
  color: #fff;
}

.pin-dots {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 22px;
}

.pin-dots span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: transparent;
  transition: background 0.15s;
}

.pin-dots span.filled {
  background: #fff;
}

.theme-ios .keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 75px);
  gap: 16px 24px;
  justify-content: center;
  margin: 0 auto;
}

.theme-ios .keypad-btn {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  border: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 400;
  cursor: pointer;
}

.theme-ios .keypad-btn:active {
  background: rgba(255, 255, 255, 0.4);
}

.theme-ios .keypad-btn small {
  font-size: 9px;
  letter-spacing: 1.5px;
  margin-top: -2px;
  font-weight: 600;
}

.theme-ios .keypad-btn.action-btn {
  background: transparent;
  font-size: 14px;
  font-weight: 400;
}

.theme-android .keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 12px 16px;
  justify-content: center;
  margin: 0 auto;
}

.theme-android .keypad-btn {
  width: 84px;
  height: 72px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
}

.theme-android .keypad-btn:active {
  background: rgba(255, 255, 255, 0.18);
}

.theme-android .keypad-btn small {
  font-size: 9.5px;
  color: var(--neu-muted);
}

.pin-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.emergency-btn, .cancel-pin-btn {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 14.5px;
  cursor: pointer;
}

/* 3. HOME */
.home-view {
  padding-top: 52px;
  padding-bottom: 12px;
  justify-content: space-between;
  background: var(--home-bg, var(--lock-bg, url('assets/lock_bg.png'))) center/cover no-repeat;
}

.home-slider {
  flex: 1;
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.home-page {
  width: 33.333%;
  height: 100%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ios-widget-row {
  display: flex;
  gap: 14px;
}

.widget-box {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(25px);
  color: #000;
  border-radius: 22px;
  padding: 14px;
}

.widget-half {
  flex: 1;
  height: 140px;
}

.widget-full {
  width: 100%;
}

.widget-box.dark {
  background: rgba(28, 28, 30, 0.75);
  color: #fff;
}

.widget-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 12px;
}

.app-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.theme-ios .app-icon-img {
  width: 60px;
  height: 60px;
  border-radius: 22%;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.theme-android .app-icon-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.app-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-icon-label {
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  text-align: center;
}

.page-dots-bar {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 6px;
}

.page-dots-bar span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.page-dots-bar span.active {
  background: #fff;
}

.theme-ios .dock-bar {
  margin: 0 12px;
  padding: 12px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(30px);
  display: flex;
  justify-content: space-around;
}

.theme-android .dock-bar {
  margin: 0 14px;
  padding: 10px 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
}

.ios-home-indicator {
  width: 134px;
  height: 5px;
  background: #fff;
  border-radius: 3px;
  margin: 8px auto 2px;
}

.theme-android .ios-home-indicator {
  display: none;
}

/* 4. GALERÍA NATIVA */
.gallery-app-view {
  background: #000;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gallery-top-bar, .gallery-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
}

.gallery-top-bar {
  top: 0;
  padding-top: calc(36px + env(safe-area-inset-top));
  justify-content: space-between;
}

.gallery-bottom-bar {
  bottom: 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  justify-content: space-around;
}

.gallery-icon-btn, .gallery-action-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.gallery-title-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-photo-day {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.gallery-photo-time {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
}

.gallery-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.android-gesture-bar {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.7);
  z-index: 60;
  cursor: pointer;
}