/* CoppolaPortal — design palette
 * Brand: Gruppo Coppola (CRD-LSW), portale "CRD System"
 * Mood: business utility, denso, minimal-formal. Niente fronzoli.
 */

:root {
  --cp-primary:   #d7282f;   /* Coppola red */
  --cp-primary-dark: #a31a20;
  --cp-accent:    #f5b71c;   /* Coppola amber */
  --cp-bg:        #f5f6f8;
  --cp-card-bg:   #ffffff;
  --cp-text:      #1f2937;
  --cp-muted:     #6b7280;
  --cp-success:   #10b981;
  --cp-danger:    #dc2626;
}

body { background: var(--cp-bg); color: var(--cp-text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.btn-primary { background-color: var(--cp-primary); border-color: var(--cp-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--cp-primary-dark); border-color: var(--cp-primary-dark); }
.btn-outline-primary { color: var(--cp-primary); border-color: var(--cp-primary); }
.btn-outline-primary:hover { background-color: var(--cp-primary); border-color: var(--cp-primary); }
a { color: var(--cp-primary); }
a:hover { color: var(--cp-primary-dark); }

.navbar.bg-dark { background-color: #ffffff !important; border-bottom: 3px solid var(--cp-primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.navbar.bg-dark .navbar-brand,
.navbar.bg-dark .nav-link { color: var(--cp-text) !important; }
.navbar.bg-dark .nav-link:hover { color: var(--cp-primary) !important; }
.navbar.bg-dark .dropdown-menu { border-color: rgba(0,0,0,0.08); }
.navbar.bg-dark { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.navbar-brand { padding-top: 0; padding-bottom: 0; }
.navbar-brand-logo { height: 64px; width: auto; vertical-align: middle; display: block; }
.cp-login-logo { max-width: 320px; width: 100%; height: auto; }

/* Login wizard */
.cp-login-wrap {
  max-width: 440px;
  margin: 6vh auto 2rem auto;
}
/* legacy login logo (overridden below) */
.cp-login-card {
  background: var(--cp-card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  padding: 2rem;
}
.cp-login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--cp-primary);
}
.cp-login-card .subtitle {
  color: var(--cp-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.cp-login-step { display: none; }
.cp-login-step.active { display: block; }

/* TOTP enroll: QR area */
.cp-qr-wrap {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}
.cp-qr-wrap canvas, .cp-qr-wrap img {
  max-width: 240px; height: auto;
}
.cp-secret-fallback {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  background: #fff;
  border: 1px dashed #adb5bd;
  border-radius: 4px;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

/* TOTP code input — large monospaced numeric */
.cp-otp-input {
  font-family: SFMono-Regular, Consolas, monospace;
  font-size: 1.6rem;
  letter-spacing: 0.4rem;
  text-align: center;
  padding: 0.6rem;
}

/* App tile grid (index.jsp) */
.cp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.cp-tile {
  background: var(--cp-card-bg);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--cp-text);
  display: flex; flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
}
.cp-tile:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.08); transform: translateY(-2px); color: var(--cp-text); }
.cp-tile-icon { font-size: 2.4rem; color: var(--cp-primary); margin-bottom: 0.75rem; }
.cp-tile-title { font-weight: 600; font-size: 1.1rem; margin: 0 0 0.4rem 0; }
.cp-tile-desc { color: var(--cp-muted); font-size: 0.9rem; flex-grow: 1; line-height: 1.35; }
.cp-tile-category {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--cp-accent); font-weight: 700; margin-bottom: 0.5rem;
}
.cp-tile-sso-badge {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: var(--cp-success); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.05em; padding: 0.1rem 0.45rem; border-radius: 9999px;
}

/* Group label between category blocks */
.cp-cat-header { color: var(--cp-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 2rem 0 0.75rem 0; }
.cp-cat-header:first-child { margin-top: 0; }

/* Toast container */
.cp-toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 1080; }

/* Admin tables */
.cp-admin-table th { background: #f8f9fa; font-weight: 600; font-size: 0.85rem; }
.cp-admin-table td { vertical-align: middle; font-size: 0.92rem; }
.cp-admin-actions { white-space: nowrap; }
.cp-pill {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 9999px;
  font-size: 0.72rem; font-weight: 600; background: #e5e7eb; color: #374151;
}
.cp-pill.success { background: #d1fae5; color: #065f46; }
.cp-pill.danger  { background: #fee2e2; color: #991b1b; }
.cp-pill.warn    { background: #fef3c7; color: #92400e; }
