@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Brand color based on Pantone 2745 C */
  --brand: #202A7D;
  
  /* UI Colors */
  --card-bg: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-on-brand: #ffffff;
  --surface: #f9fafb;
  --border-color: #e5e7eb;
  --whatsapp-green: #25d366;

  /* UI Metrics */
  --radius-md: 12px;
  --radius-lg: 24px;
  --shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* Modern CSS Reset 
*/
*, *::before, *::after {
  box-sizing: border-box;
}
body, h1, p, ul {
  margin: 0;
}

/* Global Styles & Background 
*/
body {
  background-color: var(--surface);
  color: var(--text-primary);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scroll from bokeh */
}

/* Animated Bokeh Background 
  A few blurred circles that slowly float around.
*/
.bokeh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.bokeh-bg span {
  position: absolute;
  border-radius: 50%;
  background-color: var(--brand);
  filter: blur(40px);
  opacity: 0.15;
  animation: float 25s ease-in-out infinite alternate;
}

.bokeh-bg span:nth-child(1) {
  width: 30vw;
  height: 30vw;
  top: 10vh;
  left: 5vw;
  animation-duration: 28s;
}

.bokeh-bg span:nth-child(2) {
  width: 40vw;
  height: 40vw;
  top: 40vh;
  left: 70vw;
  animation-duration: 35s;
  animation-delay: -5s;
}

.bokeh-bg span:nth-child(3) {
  width: 25vw;
  height: 25vw;
  top: 70vh;
  left: 20vw;
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes float {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(10vw, 15vh) scale(1.1);
  }
}

.container {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px 120px; /* Extra bottom padding for the bar */
}

/* Main vCard Styling 
*/
.card {
  width: 100%;
  max-width: 450px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border-color);
  transform: scale(1);
  transition: all 0.3s ease;
}

.header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

/* New rule to target the name/title wrapper for the separator */
.header > div {
  padding-left: 18px;
  margin-left: 18px;
  border-left: 1px solid var(--brand);
  height: 70px; /* Give the line a defined height */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo {
  width: 96px; /* A bit larger for better presence */
  height: 96px;
  border-radius: var(--radius-md);
  object-fit: contain; /* Use 'contain' to ensure transparent PNGs are not cropped */
  background: transparent; /* Explicitly set for transparency */
  border: none; /* Removed the border */
  flex-shrink: 0;
}

.name {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--brand); /* Changed to brand color */
  line-height: 1.2;
  margin: 0 0 4px;
}

.title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.company {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand);
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}

.info-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
}

.info-item .icon {
  width: 24px;
  height: 24px;
  color: var(--brand);
  margin-top: -2px; /* Fine-tune alignment */
}

.info-item .helper {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Fixed Bottom Action Bar 
*/
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  z-index: 100;
  border-top: 1px solid var(--border-color);
}

.bottom-bar a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-on-brand);
  font-weight: 600;
  font-size: 0.95rem;
  background-color: var(--brand);
  box-shadow: 0 4px 12px rgba(32, 42, 125, 0.2);
  border: none;
  transition: all 0.2s ease-in-out;
}

.bottom-bar a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(32, 42, 125, 0.3);
}

.bottom-bar a.whatsapp {
  background-color: var(--whatsapp-green);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}
.bottom-bar a.whatsapp:hover {
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

/* Admin Panel & Login Styles 
*/
.admin-wrap, .login {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.admin-card, .login-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.login-card {
  max-width: 450px;
}

.admin-card h2, .login-card h1 {
  margin: 0 0 16px;
  color: var(--text-primary);
  font-weight: 700;
}

/* Form Controls */
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 1rem;
  background: #fff;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(32, 42, 125, 0.1);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

label small {
  display: block;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* Buttons */
.btn, .copy-btn, .logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn, .copy-btn {
  background-color: var(--brand);
  color: var(--text-on-brand);
}
.btn:hover, .copy-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.logout-link {
  background-color: transparent;
  color: var(--brand);
  padding: 8px 12px;
}
.logout-link:hover {
  background-color: rgba(32, 42, 125, 0.05);
}

/* Admin Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 24px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th, .table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  white-space: nowrap;
}

.table th {
  background-color: var(--surface);
  font-weight: 600;
  color: var(--text-secondary);
}

.table tr:last-child td {
  border-bottom: none;
}

.table td a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}
.table td a:hover {
  text-decoration: underline;
}
.table td .copy-btn {
  padding: 6px 10px;
  font-size: 0.8rem;
  margin-left: 8px;
}

/* Alerts and Helpers */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(32, 42, 125, 0.05);
  color: var(--brand);
  margin-bottom: 16px;
  word-break: break-all;
  border: 1px solid rgba(32, 42, 125, 0.1);
}

.helper {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Responsive Tweaks */
@media (max-width: 480px) {
  .card {
    padding: 20px;
    border-radius: var(--radius-md);
  }
  .name {
    font-size: 1.5rem;
  }
  .bottom-bar {
    grid-template-columns: 1fr 1fr; /* Adjust for better fit on small screens */
  }
  .bottom-bar a:nth-child(3) {
    grid-column: 1 / -1; /* Make 3rd item full-width if it exists */
  }
}
