/* OnPunch Kiosk — OPS (OnPunch Practical System), mobile-only */

:root {
  --op-green: #14B86A;
  --op-dark: #0F172A;
  --op-gray: #64748B;
  --op-bg: #F8FAFC;
  --op-danger: #EF4444;
  --op-warning: #F59E0B;
  --op-info: #3B82F6;
  --op-border: #E2E8F0;
  --op-radius-card: 12px;
  --op-radius-btn: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--op-dark);
  color: var(--op-dark);
}

#app {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--op-bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.op-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid var(--op-border);
}
.op-company {
  font-weight: 600;
  font-size: 15px;
  color: var(--op-dark);
}

/* Screens */
.op-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
}
.op-screen.hidden { display: none; }
.op-screen-center {
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* QR scan frame */
.op-scanframe {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--op-radius-card);
  background: #000;
  overflow: hidden;
  margin-bottom: 24px;
}
#qr-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.op-scancorner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid var(--op-green);
}
.op-scancorner.tl { top: 16px; left: 16px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.op-scancorner.tr { top: 16px; right: 16px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.op-scancorner.bl { bottom: 16px; left: 16px; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.op-scancorner.br { bottom: 16px; right: 16px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }
.op-scanhint {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  text-align: center;
  color: white;
  font-size: 13px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* PIN section */
.op-pin-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.op-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--op-gray);
  margin-bottom: 12px;
  text-align: center;
}
.op-pin-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}
.op-pindot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--op-border);
  background: white;
}
.op-pindot.filled {
  background: var(--op-green);
  border-color: var(--op-green);
}

.op-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.op-key {
  background: white;
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius-btn);
  padding: 16px 0;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--op-dark);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.op-key:active { background: #F1F5F9; }
.op-key-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--op-gray);
}

.op-textbtn {
  background: none;
  border: none;
  color: var(--op-info);
  font-size: 13px;
  font-weight: 500;
  margin-top: 16px;
  padding: 8px;
}
.op-error {
  color: var(--op-danger);
  font-size: 13px;
  font-weight: 500;
  min-height: 18px;
  margin: 8px 0 0;
}

/* Manual entry */
.op-input {
  width: 100%;
  max-width: 280px;
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius-btn);
  padding: 14px 16px;
  font-size: 18px;
  text-align: center;
  margin-bottom: 16px;
  font-family: 'Inter Tight', 'Inter', sans-serif;
}

/* Buttons */
.op-btn {
  border-radius: var(--op-radius-btn);
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  max-width: 280px;
  border: none;
}
.op-btn-primary {
  background: var(--op-green);
  color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.op-btn-primary:active { background: #109a59; }
.op-btn-secondary {
  background: white;
  color: var(--op-dark);
  border: 1px solid var(--op-border);
  margin-top: 10px;
}

/* Punch / status screen */
.op-status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(20,184,106,0.12);
  color: var(--op-green);
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.op-status-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--op-dark);
  margin: 0 0 8px;
}
.op-shift {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--op-gray);
  margin-bottom: 32px;
}
.op-result-message {
  font-size: 14px;
  color: var(--op-gray);
  max-width: 320px;
  margin: 0;
}

.op-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
  margin-bottom: 8px;
}
.op-action-btn {
  border-radius: var(--op-radius-btn);
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.op-action-btn.green { background: var(--op-green); }
.op-action-btn.warning { background: var(--op-warning); }
.op-action-btn.danger { background: var(--op-danger); }
.op-action-btn.info { background: var(--op-info); }

/* Footer */
.op-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--op-border);
  background: white;
}
.op-footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--op-gray);
}
.op-footer-link {
  font-size: 12px;
  color: var(--op-gray);
  text-decoration: underline;
}

/* Modal */
.op-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.op-modal.hidden { display: none; }
.op-modal-card {
  background: white;
  border-radius: var(--op-radius-card);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.op-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--op-dark);
}
.op-modal-text {
  font-size: 14px;
  color: var(--op-gray);
  margin: 0 0 12px;
}
.op-modal-list {
  background: var(--op-bg);
  border-radius: var(--op-radius-btn);
  padding: 14px 16px;
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--op-dark);
  list-style: none;
}
.op-modal-list li { margin-bottom: 6px; }
.op-modal-list li:last-child { margin-bottom: 0; }
.op-modal-actions { display: flex; flex-direction: column; }

/* Connection badge */
.op-conn-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  background: var(--op-warning);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.op-conn-badge.hidden { display: none; }
