/* ==========================================================================
   OPENFRIO COFRE DE SENHAS - DESIGN SYSTEM & STYLES
   Cyber Vault Aesthetic: Glassmorphism, Neon Cyan & Ice Blue Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #090d16;
  --bg-card: rgba(18, 26, 43, 0.7);
  --bg-card-hover: rgba(28, 40, 65, 0.85);
  --bg-input: rgba(13, 20, 36, 0.8);
  
  --border-color: rgba(0, 242, 254, 0.15);
  --border-glow: rgba(0, 242, 254, 0.4);
  
  --primary-cyan: #00f2fe;
  --primary-blue: #4facfe;
  --accent-purple: #7f00ff;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Shadows & Glass */
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --neon-glow: 0 0 20px rgba(0, 242, 254, 0.25);
  --border-radius: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(79, 172, 254, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(127, 0, 255, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(9, 13, 22, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.5);
}

/* ==========================================================================
   AUTHENTICATION SCREEN (LOCK SCREEN)
   ========================================================================== */
.auth-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.auth-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: var(--glass-shadow), var(--neon-glow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-cyan), var(--primary-blue), var(--accent-purple));
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
  border: 1px solid var(--primary-cyan);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
  font-size: 24px;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.brand-title {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

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

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 16px;
  transition: var(--transition);
  pointer-events: none;
}

.input-control {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.input-control.mono {
  font-family: var(--font-mono);
}

.input-control:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

.input-control:focus + .input-icon {
  color: var(--primary-cyan);
}

.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.toggle-pwd-btn:hover {
  color: var(--primary-cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #050b14;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.auth-footer-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   APP HEADER & NAVIGATION
   ========================================================================== */
.app-header {
  background: rgba(13, 20, 36, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 24px;
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

/* ==========================================================================
   MAIN DASHBOARD LAYOUT
   ========================================================================== */
.app-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* Stats Overview */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--neon-glow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.cyan {
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.stat-icon.purple {
  background: rgba(127, 0, 255, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(127, 0, 255, 0.2);
}

.stat-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.stat-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Toolbar & Filters */
.toolbar-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 260px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.select-control {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--border-radius);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-control:focus {
  border-color: var(--primary-cyan);
}

.select-control option {
  background: #0d1424;
  color: var(--text-main);
}

/* Credentials Grid */
.credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.cred-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.cred-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.cred-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cred-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cred-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary-cyan);
  flex-shrink: 0;
}

.cred-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.cred-url {
  font-size: 12px;
  color: var(--primary-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  word-break: break-all;
}

.cred-url:hover {
  text-decoration: underline;
  color: var(--primary-cyan);
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-crit-alt {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-crit-med {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-crit-padrao {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cred-body {
  background: rgba(9, 13, 22, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.cred-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}

.cred-field:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.field-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

.field-value {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-value.mono {
  font-family: var(--font-mono);
}

.action-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}

.action-icon-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

.cred-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cred-dept {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cred-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius);
}

.empty-icon {
  font-size: 48px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--glass-shadow);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

.password-generator-box {
  background: rgba(0, 242, 254, 0.04);
  border: 1px solid rgba(0, 242, 254, 0.15);
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
}

.strength-bar-container {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--primary-cyan);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  animation: slideInRight 0.3s ease forwards;
}

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

/* ==========================================================================
   PRINT SPECIFIC STYLES (A4 PHYSICAL ARCHIVE)
   ========================================================================== */
#print-section {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .auth-wrapper,
  .app-header,
  .app-main,
  .modal-overlay,
  .toast-container {
    display: none !important;
  }

  #print-section {
    display: block !important;
    padding: 20px;
    background: #ffffff;
    color: #000000;
  }

  .print-header {
    border-bottom: 2px solid #0f172a;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .print-brand {
    font-size: 20pt;
    font-weight: bold;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .print-subtitle {
    font-size: 10pt;
    color: #475569;
  }

  .print-meta {
    text-align: right;
    font-size: 9pt;
    color: #64748b;
  }

  .print-confidential-banner {
    background: #f1f5f9;
    border-left: 4px solid #ef4444;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 9.5pt;
    color: #334155;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    text-align: left;
    font-size: 9.5pt;
    word-break: break-word;
  }

  .print-table th {
    background-color: #f8fafc;
    font-weight: bold;
    color: #0f172a;
    text-transform: uppercase;
    font-size: 8.5pt;
  }

  .print-table tr:nth-child(even) {
    background-color: #f8fafc;
  }

  .font-mono {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
  }

  .print-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    page-break-inside: avoid;
  }

  .signature-box {
    width: 250px;
    text-align: center;
    border-top: 1px solid #000000;
    padding-top: 5px;
    font-size: 9pt;
    color: #334155;
  }
}
