/* ARC Remote Desktop - Stile Ufficiale Archimede A.S.I. srl (www.arc.it) */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #070c18;
  --bg-secondary: #0e182f;
  --bg-card: rgba(16, 28, 56, 0.75);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 168, 255, 0.35);
  --brand-blue: #0070ba;
  --brand-cyan: #00c2ff;
  --brand-cyan-glow: rgba(0, 194, 255, 0.2);
  --brand-gradient: linear-gradient(135deg, #0070ba 0%, #00c2ff 100%);
  --brand-accent: #00d285;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --header-height: 56px;
  --toolbar-height: 44px;
}

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

body {
  font-family: 'Raleway', 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

/* Header Superiore */
.arc-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 2px 8px var(--brand-cyan-glow));
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.brand-badge {
  font-size: 0.68rem;
  background: rgba(0, 194, 255, 0.15);
  color: var(--brand-cyan);
  border: 1px solid var(--brand-cyan);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
}

.version-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.version-divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.25);
  display: inline-block;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pill.connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-pill.connecting .status-dot {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.target-id-badge {
  font-family: 'Inter', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--brand-cyan);
}

/* Barra Strumenti Controllo Remoto */
.arc-toolbar {
  height: var(--toolbar-height);
  background: rgba(14, 24, 47, 0.95);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: rgba(0, 194, 255, 0.15);
  border-color: var(--brand-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.tool-btn.active {
  background: var(--brand-blue);
  border-color: var(--brand-cyan);
  color: #fff;
}

.tool-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: #fca5a5;
}

.clipboard-status-tag {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid var(--success);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* Area Schermo Remoto */
.viewport-container {
  flex: 1;
  position: relative;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  outline: none;
}

#remoteCanvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  cursor: default;
}

/* Modale Connessione Iniziale & Download */
.connect-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(0, 112, 186, 0.22) 0%, rgba(7, 12, 24, 0.96) 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(10px);
  padding: 30px 20px;
  overflow-y: auto;
}

.connect-cards-wrapper {
  display: flex;
  gap: 32px;
  align-items: stretch;
  justify-content: center;
  max-width: 980px;
  width: 100%;
  margin: auto;
}

.connect-card {
  flex: 1 1 440px;
  max-width: 470px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px var(--brand-cyan-glow);
  text-align: center;
  animation: cardFadeIn 0.35s ease-out;
  display: flex;
  flex-direction: column;
}

/* 1. Card Download: Tema Ciano / Electric Sky Blue */
.connect-card.download-card {
  background: linear-gradient(165deg, rgba(8, 30, 56, 0.95) 0%, rgba(6, 18, 34, 0.98) 100%);
  border: 1px solid rgba(0, 194, 255, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 35px rgba(0, 194, 255, 0.2);
}

.card-badge.badge-download {
  background: rgba(0, 194, 255, 0.18);
  border: 1px solid #00c2ff;
  color: #38bdf8;
}

.card-title.title-download {
  background: linear-gradient(135deg, #38bdf8 0%, #00e5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.download-card .download-features {
  background: rgba(4, 16, 32, 0.7);
  border: 1px solid rgba(0, 194, 255, 0.18);
}

/* 2. Card Controllo: Tema Royal Violet / Deep Amethyst */
.connect-card.control-card {
  background: linear-gradient(165deg, rgba(42, 20, 72, 0.95) 0%, rgba(20, 12, 38, 0.98) 100%);
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 35px rgba(168, 85, 247, 0.22);
}

.card-badge.badge-control {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid #a855f7;
  color: #c084fc;
}

.card-title.title-control {
  background: linear-gradient(135deg, #c084fc 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.control-card .form-label {
  color: #d8b4fe;
}

.control-card .form-input {
  background: rgba(15, 8, 28, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.control-card .form-input:focus {
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

.control-card .btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  border: 1px solid #a855f7;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.control-card .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.7);
  border-color: #fff;
}

.card-badge {
  display: inline-block;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(0, 194, 255, 0.15);
  border: 1px solid var(--brand-cyan);
  color: var(--brand-cyan);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.download-features {
  background: rgba(7, 12, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.feature-item strong {
  color: #fff;
}

.feature-icon {
  font-size: 1.1rem;
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-radius: 10px;
  text-decoration: none;
  text-align: left;
  transition: all 0.25s ease;
  font-family: inherit;
}

.btn-download-exe {
  background: var(--brand-gradient);
  color: #fff;
  border: 1px solid var(--brand-cyan);
  box-shadow: 0 4px 18px rgba(0, 112, 186, 0.5);
}

.btn-download-exe:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 194, 255, 0.65);
  border-color: #fff;
}

.btn-download-zip {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-download-zip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.btn-content strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.btn-content small {
  display: block;
  font-size: 0.74rem;
  opacity: 0.82;
  margin-top: 3px;
}

/* Box Aiuto Windows SmartScreen */
.smartscreen-tip {
  background: rgba(0, 194, 255, 0.08);
  border: 1px solid rgba(0, 194, 255, 0.28);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  margin-bottom: 14px;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.tip-icon {
  font-size: 0.95rem;
}

.tip-text {
  margin: 0;
}

.smartscreen-tip u {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
  margin: 0 2px;
}

@media (max-width: 960px) {
  .connect-cards-wrapper {
    flex-direction: column;
    align-items: center;
  }
  .connect-card {
    width: 100%;
    max-width: 440px;
  }
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.card-logo {
  height: 46px;
  width: auto;
  max-width: 155px;
  object-fit: contain;
  align-self: center;
  margin: 0 auto 16px auto;
  display: block;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  background: rgba(7, 12, 24, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-cyan);
  box-shadow: 0 0 12px var(--brand-cyan-glow);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--brand-gradient);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0, 112, 186, 0.4);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 194, 255, 0.5);
}

.card-footer {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-footer a {
  color: var(--brand-cyan);
  text-decoration: none;
}

.card-footer a:hover {
  text-decoration: underline;
}

/* Toast Notifiche */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: rgba(14, 24, 47, 0.95);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-cyan);
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(10px);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger { border-left-color: var(--danger); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
