/* =============================================
   SANSKARDHANI PARIVAR ID CARD – Frontend CSS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Montserrat:wght@400;600;800&family=Playfair+Display:ital,wght@1,600&display=swap');

:root {
  --sdic-dark-blue:  #0b1a30;
  --sdic-orange:     #e67e22;
  --sdic-gold:       #f1c40f;
  --sdic-maroon:     #7a1f1f;
  --sdic-text-dark:  #333;
  --sdic-text-light: #666;
  --sdic-white:      #fff;
  --sdic-radius:     16px;
  --sdic-shadow:     0 8px 32px rgba(0,0,0,0.14);
}

/* ── Wrapper ── */
.sdic-wrapper {
  font-family: 'Montserrat', sans-serif;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ═══════════════════════════════════════════
   FORM SECTION
═══════════════════════════════════════════ */

.sdic-form-section {
  background: #fff;
  border-radius: var(--sdic-radius);
  box-shadow: var(--sdic-shadow);
  overflow: hidden;
  margin-bottom: 32px;
}

.sdic-form-header {
  background: linear-gradient(135deg, var(--sdic-dark-blue), #1a3a5c);
  color: #fff;
  text-align: center;
  padding: 36px 24px 28px;
}

.sdic-form-logo {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 10px;
}

.sdic-form-header h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--sdic-gold);
}

.sdic-form-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.sdic-form-body {
  padding: 28px 24px;
}

/* Photo upload */
.sdic-photo-upload-area {
  text-align: center;
  margin-bottom: 28px;
}

.sdic-photo-preview {
  display: inline-block;
  position: relative;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  width: 120px;
  height: 120px;
  border: 4px solid var(--sdic-orange);
  box-shadow: 0 4px 16px rgba(230,126,34,0.25);
}

.sdic-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sdic-photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 24px;
}

.sdic-photo-overlay small {
  font-size: 11px;
  margin-top: 4px;
}

.sdic-photo-preview:hover .sdic-photo-overlay {
  opacity: 1;
}

.sdic-photo-hint {
  font-size: 12px;
  color: var(--sdic-text-light);
  margin-top: 10px;
}

/* Form fields */
.sdic-fields {
  display: grid;
  gap: 18px;
}

.sdic-field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sdic-field-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sdic-dark-blue);
  display: flex;
  align-items: center;
  gap: 7px;
}

.sdic-field-icon {
  font-size: 16px;
}

.sdic-field-group input[type="text"],
.sdic-field-group input[type="tel"] {
  padding: 13px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Montserrat', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.sdic-field-group input:focus {
  border-color: var(--sdic-orange);
  box-shadow: 0 0 0 3px rgba(230,126,34,0.15);
}

.required {
  color: #e53e3e;
}

.sdic-terms label {
  font-size: 13px;
  font-weight: 400;
  color: var(--sdic-text-dark);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.sdic-terms input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--sdic-orange);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Buttons */
.sdic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.sdic-btn-primary {
  background: linear-gradient(135deg, var(--sdic-orange), #d35400);
  color: #fff;
  width: 100%;
  font-size: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(230,126,34,0.4);
}

.sdic-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(230,126,34,0.5);
}

.sdic-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.sdic-btn-secondary {
  background: #f0f0f0;
  color: var(--sdic-text-dark);
  margin-top: 16px;
}

.sdic-btn-secondary:hover {
  background: #e0e0e0;
}

.sdic-btn-download {
  background: var(--sdic-dark-blue);
  color: var(--sdic-gold);
  border: 2px solid var(--sdic-gold);
  flex: 1;
}

.sdic-btn-download:hover {
  background: #142a4a;
}

.sdic-btn-whatsapp {
  background: #25d366;
  color: #fff;
}

.sdic-btn-facebook {
  background: #1877f2;
  color: #fff;
}

.sdic-btn-twitter {
  background: #000;
  color: #fff;
}

/* Alerts */
.sdic-alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin: 0 24px 16px;
  font-size: 14px;
}

.sdic-alert-error {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #c53030;
}

/* ═══════════════════════════════════════════
   CARD OUTPUT SECTION
═══════════════════════════════════════════ */

.sdic-card-section {
  animation: sdicFadeIn 0.5s ease;
}

@keyframes sdicFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sdic-card-success-msg {
  text-align: center;
  padding: 20px;
}

.sdic-card-success-msg span {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.sdic-card-success-msg h3 {
  font-size: 24px;
  color: var(--sdic-dark-blue);
  font-weight: 800;
  margin: 0 0 6px;
}

.sdic-card-success-msg p {
  color: var(--sdic-text-light);
  font-size: 15px;
  margin: 0;
}

/* ═══════════════════════════════════════════
   THE ID CARD ITSELF
═══════════════════════════════════════════ */

.sdic-id-card {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 20px;
  font-family: 'Montserrat', sans-serif;
  position: relative;
  overflow: hidden;
}

.sdic-card-inner {
  background:
    linear-gradient(rgba(240, 245, 250, 0.88), rgba(220, 230, 240, 0.88)),
    var(--sdic-bg-img, #cfd9e8) center/cover no-repeat;
  border-radius: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Fixed design width. On smaller screens JS scales this down proportionally
     (transform: scale) instead of restructuring into a stacked layout \u2014
     the card must always stay a landscape ID card, like a physical card would
     just appear smaller, never re-flow into a portrait shape. */
  width: 900px;
  transform-origin: top left;
}

.sdic-bg-watermark {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.sdic-card-inner > *:not(.sdic-bg-watermark) {
  position: relative;
  z-index: 1;
}

/* Header */
.sdic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 36px 10px 36px;
}

.sdic-logo-left img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sdic-orange);
}

.sdic-header-center {
  text-align: center;
  flex-grow: 1;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sdic-temple-silhouette {
  width: 90px;
  height: 28px;
  object-fit: contain;
  margin-bottom: 4px;
}

.sdic-connecting-text {
  font-family: 'Dancing Script', cursive;
  color: var(--sdic-orange);
  font-size: 30px;
  margin-bottom: -8px;
}

.sdic-jabalpuriya-text {
  color: var(--sdic-dark-blue);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
}

.sdic-tagline-container {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 10px;
}

.sdic-tagline-line {
  flex-grow: 1;
  height: 1px;
  background-color: var(--sdic-text-dark);
}

.sdic-tagline {
  padding: 0 12px;
  font-weight: 600;
  color: var(--sdic-text-dark);
  font-size: 12px;
  white-space: nowrap;
}

.sdic-header-right {
  text-align: right;
}

.sdic-id-number {
  color: var(--sdic-maroon);
  font-size: 26px;
  font-weight: 800;
}

.sdic-registered-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--sdic-text-dark);
}

/* Banner */
.sdic-banner-container {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

.sdic-banner {
  background-color: var(--sdic-dark-blue);
  color: white;
  padding: 8px 36px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sdic-banner::before,
.sdic-banner::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background-color: var(--sdic-orange);
  border-radius: 50%;
}

/* Main content */
.sdic-main-content {
  display: flex;
  padding: 0 36px;
  position: relative;
  align-items: flex-start;
  margin-top: 10px;
}

.sdic-profile-section {
  flex: 0 0 190px;
}

.sdic-profile-pic {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 5px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  object-fit: cover;
}

.sdic-details-section {
  flex-grow: 1;
  padding-left: 36px;
  padding-right: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 8px;
}

.sdic-detail-row {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.sdic-detail-last {
  border-bottom: none;
}

.sdic-detail-icon {
  width: 30px;
  height: 30px;
  border: 1px solid var(--sdic-dark-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  font-size: 13px;
  flex-shrink: 0;
}

.sdic-detail-label {
  width: 145px;
  font-weight: 600;
  font-size: 11px;
  color: var(--sdic-dark-blue);
  flex-shrink: 0;
}

.sdic-detail-value {
  font-weight: 600;
  font-size: 17px;
  color: #000;
}

.sdic-seal-right {
  position: absolute;
  top: -55px;
  right: 36px;
}

.sdic-seal-right img {
  width: 130px;
  height: 130px;
  object-fit: contain;
}

/* Lower section */
.sdic-lower-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 18px 36px;
}

.sdic-quote-box {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--sdic-dark-blue);
  max-width: 58%;
  line-height: 1.5;
}

.sdic-quote-marks {
  color: var(--sdic-orange);
  font-size: 28px;
  font-style: normal;
  font-family: sans-serif;
  font-weight: bold;
  line-height: 0.5;
  vertical-align: -8px;
}

.sdic-signature-box {
  text-align: center;
}

.sdic-signature-img {
  height: 58px;
  display: block;
  margin: 0 auto 4px;
  object-fit: contain;
}

.sdic-signature-name {
  font-weight: 800;
  color: var(--sdic-maroon);
  font-size: 17px;
}

.sdic-signature-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--sdic-text-dark);
  letter-spacing: 0.5px;
}

/* Bottom bar */
.sdic-bottom-bar {
  background-color: var(--sdic-dark-blue);
  padding: 14px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 25px 25px;
}

.sdic-action-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.sdic-action-item {
  color: var(--sdic-gold);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 1px;
}

.sdic-divider {
  color: rgba(255,255,255,0.3);
  margin-left: 14px;
}

/* Share / Download actions */
.sdic-share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 0 4px;
  align-items: center;
}

.sdic-share-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sdic-share-btns .sdic-btn {
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

/* The ID card itself intentionally does NOT restructure on mobile — it stays a
   landscape card and is scaled down as a whole (see sdicScaleCard() in frontend.js).
   Only the surrounding page chrome (form section, buttons) reflows for small screens. */

@media (max-width: 680px) {
  .sdic-share-actions {
    flex-direction: column;
  }

  .sdic-btn-download {
    width: 100%;
  }

  .sdic-share-btns {
    width: 100%;
    justify-content: center;
  }
}

/* Prevents a flash of the full-size (unscaled) card before JS calculates the
   right scale factor on load. */
.sdic-id-card {
  min-height: 60px;
}
/* Custom ID number toggle + live availability status */
.sdic-custom-id-toggle { margin-bottom: 4px; }
#sdic-custom-id-wrap { margin-top: 6px; margin-bottom: 16px; }
.sdic-custom-id-status {
  font-size: 13px;
  margin-top: 6px;
  min-height: 18px;
  font-weight: 600;
}
.sdic-custom-id-status.is-available { color: #16a34a; }
.sdic-custom-id-status.is-taken,
.sdic-custom-id-status.is-invalid { color: #dc2626; }
