/* =====================================================================
   PBTOA ID Registration System — Public site styles
   Theme: White + Red, professional institutional look
   ===================================================================== */

:root {
  --pbtoa-red: #b3121b;
  --pbtoa-red-dark: #8f0e16;
  --pbtoa-red-light: #fdecec;
  --pbtoa-white: #ffffff;
  --pbtoa-gray-bg: #f6f6f7;
  --pbtoa-gray-card: #fafafa;
  --pbtoa-gray-border: #e3e3e3;
  --pbtoa-text: #2b2b2b;
  --pbtoa-text-muted: #6b6b6b;
  --pbtoa-radius: 0.6rem;
  --pbtoa-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

body {
  background-color: var(--pbtoa-gray-bg);
  color: var(--pbtoa-text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--pbtoa-red); text-decoration: none; }
a:hover { color: var(--pbtoa-red-dark); text-decoration: underline; }

/* ---------------------------------------------------------------------
   Top navigation
   --------------------------------------------------------------------- */
.pbtoa-navbar {
  background-color: var(--pbtoa-white);
  border-bottom: 3px solid var(--pbtoa-red);
  box-shadow: var(--pbtoa-shadow);
}
.pbtoa-navbar .navbar-brand {
  font-weight: 700;
  color: var(--pbtoa-red);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.pbtoa-logo-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--pbtoa-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.pbtoa-navbar .nav-link {
  color: var(--pbtoa-text);
  font-weight: 500;
}
.pbtoa-navbar .nav-link:hover,
.pbtoa-navbar .nav-link.active {
  color: var(--pbtoa-red);
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn-pbtoa {
  background-color: var(--pbtoa-red);
  border-color: var(--pbtoa-red);
  color: #fff;
}
.btn-pbtoa:hover,
.btn-pbtoa:focus {
  background-color: var(--pbtoa-red-dark);
  border-color: var(--pbtoa-red-dark);
  color: #fff;
}
.btn-outline-pbtoa {
  border-color: var(--pbtoa-red);
  color: var(--pbtoa-red);
  background: transparent;
}
.btn-outline-pbtoa:hover {
  background-color: var(--pbtoa-red);
  color: #fff;
}

/* ---------------------------------------------------------------------
   Cards / sections
   --------------------------------------------------------------------- */
.pbtoa-card {
  background: var(--pbtoa-white);
  border: 1px solid var(--pbtoa-gray-border);
  border-radius: var(--pbtoa-radius);
  box-shadow: var(--pbtoa-shadow);
}
.pbtoa-hero {
  background: linear-gradient(135deg, var(--pbtoa-red) 0%, var(--pbtoa-red-dark) 100%);
  color: #fff;
  border-radius: var(--pbtoa-radius);
  padding: 3rem 2rem;
}
.pbtoa-hero h1 { font-weight: 700; }
.pbtoa-hero p { opacity: 0.95; }

.section-title {
  color: var(--pbtoa-red);
  font-weight: 700;
  border-left: 4px solid var(--pbtoa-red);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.required-mark { color: var(--pbtoa-red); font-weight: 700; }

.form-label { font-weight: 600; color: var(--pbtoa-text); }

.form-control:focus,
.form-select:focus {
  border-color: var(--pbtoa-red);
  box-shadow: 0 0 0 0.2rem rgba(179, 18, 27, 0.15);
}

.image-upload-box {
  border: 2px dashed var(--pbtoa-gray-border);
  border-radius: var(--pbtoa-radius);
  background: var(--pbtoa-gray-card);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
}
.image-upload-box:hover { border-color: var(--pbtoa-red); }
.image-upload-box img.preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 0.4rem;
  margin-top: 0.75rem;
  border: 1px solid var(--pbtoa-gray-border);
  display: none;
}
.image-upload-box img.preview.show { display: inline-block; }

.field-error {
  color: var(--pbtoa-red-dark);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}
.field-error.show { display: block; }
.is-invalid ~ .field-error,
.field-error.show { display: block; }

/* ---------------------------------------------------------------------
   Confirmation / success page
   --------------------------------------------------------------------- */
.success-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #e9f9ef;
  color: #1e8e4f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.25rem;
}
.reference-box {
  background: var(--pbtoa-red-light);
  border: 1px dashed var(--pbtoa-red);
  border-radius: var(--pbtoa-radius);
  padding: 1rem 1.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pbtoa-red-dark);
  letter-spacing: 1px;
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.pbtoa-footer {
  background: var(--pbtoa-white);
  border-top: 1px solid var(--pbtoa-gray-border);
  color: var(--pbtoa-text-muted);
  font-size: 0.875rem;
  padding: 1.25rem 0;
}

/* ---------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff 0%, var(--pbtoa-gray-bg) 100%);
  padding: 1.5rem;
}
.login-card {
  max-width: 420px;
  width: 100%;
  background: var(--pbtoa-white);
  border-radius: var(--pbtoa-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 2.25rem;
  border-top: 4px solid var(--pbtoa-red);
}
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pbtoa-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 auto 1rem;
}

/* ---------------------------------------------------------------------
   Image crop & enhance editor
   --------------------------------------------------------------------- */
.image-editor-crop-area {
  max-height: 55vh;
  overflow: hidden;
  background: #222;
  border-radius: 0.4rem;
}
.image-editor-crop-area img {
  display: block;
  max-width: 100%;
}
.edit-image-btn {
  display: none;
  margin-top: 0.5rem;
}
.edit-image-btn.show { display: inline-block; }

/* ---------------------------------------------------------------------
   Signature drawing pad
   --------------------------------------------------------------------- */
.signature-pad-frame {
  border: 2px dashed var(--pbtoa-gray-border);
  border-radius: 0.4rem;
  background: #fff;
  touch-action: none;
}
.signature-pad-frame canvas {
  display: block;
  width: 100%;
  height: 240px;
  cursor: crosshair;
}

/* ---------------------------------------------------------------------
   Responsive tweaks
   --------------------------------------------------------------------- */
@media (max-width: 576px) {
  .pbtoa-hero { padding: 2rem 1.25rem; }
  .login-card { padding: 1.5rem; }
}
