/* ==========================================================================
   Brother T220 Print - Authentic Apple iOS Dark Theme
   100% Pure iOS Dark Mode (#000000 / #1c1c1e) with System Colors
   ========================================================================== */

:root {
  --ios-bg: #000000;
  --ios-card: #1c1c1e;
  --ios-card-border: rgba(255, 255, 255, 0.08);
  --ios-blue: #0a84ff;
  --ios-blue-active: #0071e3;
  --ios-green: #30d158;
  --ios-red: #ff453a;
  --ios-text: #ffffff;
  --ios-secondary-text: #8e8e93;
  --ios-tertiary-text: #636366;
  --ios-input-bg: #2c2c2e;
  --ios-radius: 14px;
  --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
}

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

body {
  background-color: var(--ios-bg);
  color: var(--ios-text);
  font-family: var(--ios-font);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Common SVG styling */
.ios-svg-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.btn-svg {
  width: 17px;
  height: 17px;
  display: inline-block;
  vertical-align: middle;
}

/* ==========================================================================
   1. AUTHENTIC iOS PASSCODE LOCK SCREEN
   ========================================================================== */
.passcode-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 40px) + 20px) 24px calc(env(safe-area-inset-bottom, 30px) + 20px) 24px;
  background-color: #000000;
}

.passcode-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.lock-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  color: #ffffff;
}

.passcode-header h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.passcode-header p {
  font-size: 13px;
  color: var(--ios-secondary-text);
}

/* Passcode 4 Dots */
.passcode-dots {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  background-color: transparent;
  transition: all 0.15s ease-out;
}

.pin-dot.filled {
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Quick Biometric Face ID Button */
.biometric-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.3);
  color: var(--ios-blue);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin: 6px 0 14px 0;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.biometric-pill-btn:active {
  background: rgba(10, 132, 255, 0.28);
  transform: scale(0.97);
}

.face-id-mini {
  width: 17px;
  height: 17px;
  stroke: var(--ios-blue);
}

.face-id-svg {
  width: 32px;
  height: 32px;
  stroke: #ffffff;
}

/* Passcode Shake Animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-14px); }
  40%, 80% { transform: translateX(14px); }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

/* Authentic iOS Keypad */
.ios-keypad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 16px 26px;
  justify-content: center;
  margin-bottom: 10px;
}

.key-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.1s ease;
}

.key-btn:active {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0.96);
}

.key-num {
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.key-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--ios-secondary-text);
  margin-top: 2px;
}

.empty-key {
  visibility: hidden;
}

.action-key {
  background: transparent;
  color: #ffffff;
}

.action-key:active {
  background: transparent;
  opacity: 0.6;
}

/* ==========================================================================
   2. MAIN PRINT INTERFACE
   ========================================================================= */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 20px);
  padding-bottom: env(safe-area-inset-bottom, 20px);
  padding-left: 16px;
  padding-right: 16px;
  max-width: 460px;
  margin: 0 auto;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px 10px 4px;
}

.app-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ios-card);
  border: 1px solid var(--ios-card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-blue);
}

.title-meta h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ios-secondary-text);
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ios-tertiary-text);
}

.status-pulse.online {
  background-color: var(--ios-green);
  box-shadow: 0 0 6px rgba(48, 209, 88, 0.6);
}

.status-pulse.offline {
  background-color: var(--ios-red);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-round-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ios-card);
  border: 1px solid var(--ios-card-border);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
}

.icon-round-btn:active {
  opacity: 0.6;
}

/* Main Content Layout */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

/* iOS Inset Card */
.ios-card {
  background-color: var(--ios-card);
  border: 1px solid var(--ios-card-border);
  border-radius: var(--ios-radius);
  padding: 16px;
}

.card-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--ios-secondary-text);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* Upload Drop Card */
.upload-card {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  text-align: center;
  padding: 24px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: block;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.upload-card:active {
  background: rgba(255, 255, 255, 0.04);
}

.hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.0001;
  cursor: pointer;
  z-index: 5;
  -webkit-appearance: none;
}

.upload-card.has-file .hidden-input {
  display: none;
}

.remove-file-btn {
  position: relative;
  z-index: 25;
}

.upload-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(10, 132, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  color: var(--ios-blue);
}

.upload-icon-circle svg {
  width: 26px;
  height: 26px;
}

.upload-idle h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-idle p {
  font-size: 12px;
  color: var(--ios-secondary-text);
  margin-bottom: 12px;
}

.upload-tags {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.ios-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #d1d1d6;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Selected File Preview */
.file-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.doc-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--ios-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-names {
  flex: 1;
  overflow: hidden;
}

.file-names h4 {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-names p {
  font-size: 12px;
  color: var(--ios-secondary-text);
}

.remove-file-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.remove-file-btn svg {
  width: 14px;
  height: 14px;
}

/* Segmented Control (Apple iOS UISegmentedControl style) */
.segmented-control {
  display: flex;
  background: #121214;
  border-radius: 9px;
  padding: 2px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ios-secondary-text);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.segment-btn.active {
  background: #2c2c2e;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* Row elements */
.ios-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.row-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.row-sub {
  display: block;
  font-size: 12px;
  color: var(--ios-secondary-text);
}

.row-value {
  font-size: 13px;
  color: #d1d1d6;
  font-weight: 500;
}

.ios-row-plain {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* iOS Stepper */
.ios-stepper {
  display: flex;
  align-items: center;
  background: #2c2c2e;
  border-radius: 8px;
  overflow: hidden;
}

.stepper-action {
  background: transparent;
  border: none;
  color: var(--ios-blue);
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stepper-action svg {
  width: 16px;
  height: 16px;
}

.stepper-action:active {
  background: rgba(255, 255, 255, 0.1);
}

.stepper-val {
  width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

/* Primary Print Button */
.action-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ios-primary-btn {
  background-color: var(--ios-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--ios-radius);
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.3);
  transition: transform 0.1s, opacity 0.2s, background-color 0.2s;
}

.ios-primary-btn:active:not(:disabled) {
  background-color: var(--ios-blue-active);
  transform: scale(0.98);
}

.ios-primary-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* Progress bar */
.upload-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ios-blue);
  transition: width 0.2s;
}

/* Queue Card & Items */
.card-header-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ios-text-btn {
  background: transparent;
  border: none;
  color: var(--ios-blue);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ios-text-btn:active {
  opacity: 0.6;
}

.font-bold {
  font-weight: 600;
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 24px 0;
  color: var(--ios-tertiary-text);
}

.empty-svg {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
}

.job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #121214;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: 10px;
}

.job-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.job-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-meta {
  font-size: 11px;
  color: var(--ios-secondary-text);
}

.job-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.job-status-pill.pending {
  background: rgba(255, 159, 10, 0.18);
  color: #ff9f0a;
}

.job-status-pill.downloaded {
  background: rgba(10, 132, 255, 0.18);
  color: var(--ios-blue);
}

.job-status-pill.printing {
  background: rgba(10, 132, 255, 0.25);
  color: var(--ios-blue);
}

.job-status-pill.completed {
  background: rgba(48, 209, 88, 0.18);
  color: var(--ios-green);
}

.job-status-pill.failed {
  background: rgba(255, 69, 58, 0.18);
  color: var(--ios-red);
}

/* ==========================================================================
   3. SETTINGS SHEET (iOS Modal)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 1000;
}

.modal-sheet {
  background: #1c1c1e;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 20px) + 20px) 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 12px auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.ios-input-group {
  margin-bottom: 14px;
}

.ios-input-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ios-secondary-text);
  margin-bottom: 6px;
}

.ios-input-group input {
  width: 100%;
  background: var(--ios-input-bg);
  border: 1px solid var(--ios-card-border);
  color: #ffffff;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
}

.ios-input-group input:focus {
  outline: none;
  border-color: var(--ios-blue);
}

.input-hint {
  display: block;
  font-size: 11px;
  color: var(--ios-tertiary-text);
  margin-top: 4px;
}

.ios-secondary-btn {
  width: 100%;
  background: var(--ios-blue);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.ios-secondary-btn:active {
  background-color: var(--ios-blue-active);
}

/* ==========================================================================
   4. TOAST NOTIFICATION
   ========================================================================== */
.ios-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 20px) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(30, 30, 32, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1500;
  pointer-events: none;
  white-space: nowrap;
}

.ios-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
