/* ============================================
   BIO DATA MAKER - STYLES
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --accent: #e6a817;
    --accent-hover: #f0bc3c;
    --border: #2a2a4a;
    --shadow: rgba(0, 0, 0, 0.4);
}

html {
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   APP HEADER
   ============================================ */
.app-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
}

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

.logo-icon {
    font-size: 28px;
}

.logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #f0d78c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-content {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 72px);
}

/* ============================================
   FORM PANEL (Left Side)
   ============================================ */
.form-panel {
    width: 480px;
    min-width: 480px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
    height: calc(100vh - 72px);
    position: sticky;
    top: 72px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.panel-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.btn-toggle-preview {
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-toggle-preview:hover {
    background: var(--accent);
    color: #000;
}

/* Form Elements */
.top-icon-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.icon-option-lbl {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.15);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    user-select: none;
}

.icon-option-lbl:hover, .icon-option-lbl:has(input:checked) { 
    border-color: var(--accent);
    background: rgba(230, 168, 23, 0.1);
}

.icon-option-lbl input { 
    cursor: pointer;
}

.icon-option-img { 
    height: 24px; 
    object-fit: contain; 
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Dynamic Field Row */
.dynamic-field-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dynamic-field-row:hover {
    border-color: rgba(230, 168, 23, 0.3);
}

.dynamic-field-row.dragging {
    opacity: 0.5;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(230, 168, 23, 0.2);
}

.dynamic-field-row.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(230, 168, 23, 0.3);
}

.field-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 2px;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.field-drag-handle:active { cursor: grabbing; }
.dynamic-field-row:hover .field-drag-handle { opacity: 1; }

.field-inputs {
    flex: 1;
    display: flex;
    gap: 6px;
}

.field-inputs input {
    background: rgba(0,0,0,0.2);
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 6px 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.field-inputs input:focus {
    border-color: var(--accent);
}

.field-inputs .field-label-input { width: 38%; }
.field-inputs .field-value-input { flex: 1; }

.field-inputs input::placeholder {
    color: #555;
    font-size: 11px;
}

.field-move-btns {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.field-move-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s;
    opacity: 0.5;
}

.dynamic-field-row:hover .field-move-btn { opacity: 1; }
.field-move-btn:hover { color: var(--accent); }

.field-delete-btn {
    background: none;
    border: none;
    color: #aa4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.4;
}

.dynamic-field-row:hover .field-delete-btn { opacity: 1; }
.field-delete-btn:hover { color: #ff4444; background: rgba(255,68,68,0.1); }

.btn-add-field {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
    margin-top: 4px;
    width: 100%;
    justify-content: center;
}

.btn-add-field:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(230, 168, 23, 0.05);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--bg-input);
}

.template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.template-card.active {
    border-color: var(--accent);
    background: rgba(230, 168, 23, 0.1);
    box-shadow: 0 0 12px rgba(230, 168, 23, 0.2);
}

.template-card span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.template-card.active span {
    color: var(--accent);
}

.template-mini {
    width: 56px;
    height: 72px;
    border-radius: 4px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    overflow: hidden;
}

.template-mini-1 {
    background: #faf5e4;
    border: 2px solid #1a7a6d;
}

.template-mini-2 {
    background: #fdf0ee;
    border: 2px solid #e8a0b0;
}

.template-mini-3 {
    background: #fff;
    border: 2px solid #b8860b;
}

.template-mini-4 {
    background: #fff;
    border: 2px solid #b8860b;
}

.template-mini-5 {
    background: #f5f0e0;
    border: 2px solid #6b5b3e;
}

.mini-header {
    font-size: 5px;
    font-weight: 700;
    text-align: center;
    margin-top: 4px;
}

.mini-lines {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.mini-lines::before,
.mini-lines::after {
    content: '';
    display: block;
    height: 2px;
    background: rgba(0,0,0,0.15);
    border-radius: 1px;
}

.mini-lines::after {
    width: 70%;
}

/* Form Sections */
.form-section {
    margin-bottom: 24px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(230, 168, 23, 0.15);
}

.form-group input::placeholder {
    color: #555;
    font-size: 12px;
}

/* Photo Upload */
.photo-upload-area {
    width: 150px;
    height: 180px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    overflow: hidden;
    position: relative;
    background: var(--bg-input);
}

.photo-upload-area:hover {
    border-color: var(--accent);
    background: rgba(230, 168, 23, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    padding: 12px;
}

.upload-icon {
    font-size: 32px;
}

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

.btn-remove-photo {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 50, 50, 0.9);
    border: none;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-remove-photo:hover {
    transform: scale(1.15);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #d4941a);
    color: #000;
    box-shadow: 0 4px 15px rgba(230, 168, 23, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 168, 23, 0.5);
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: rgba(230, 168, 23, 0.1);
}

/* ============================================
   PREVIEW PANEL (Right Side)
   ============================================ */
.preview-panel {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px;
    overflow-y: auto;
    height: calc(100vh - 72px);
    position: sticky;
    top: 72px;
    background: repeating-conic-gradient(#1a1a2e 0% 25%, #151525 0% 50%) 0 0 / 20px 20px;
}

.preview-container {
    width: 595px; /* A4 width at 72dpi */
    min-height: 842px; /* A4 height */
    transform-origin: top center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: 2px;
}

/* ============================================
   BIODATA PAGE BASE
   ============================================ */
.biodata-page {
    width: 595px;
    min-height: 842px;
    position: relative;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    background: #fff;
}

/* ============================================
   TEMPLATE 1: TRADITIONAL GANESH
   Cream background, teal/cyan decorative 
   corner borders, Ganesh icon
   ============================================ */
.template-1 {
    background: #faf5e4;
    padding: 0;
}

.t1-border-frame {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 2px solid #1a7a6d;
    pointer-events: none;
}

/* Outer decorative line */
.t1-border-outer {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid #1a7a6d;
    pointer-events: none;
}

/* Corner ornaments for Template 1 */
.t1-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    pointer-events: none;
}

.t1-corner svg {
    width: 100%;
    height: 100%;
}

.t1-corner-tl { top: 6px; left: 6px; }
.t1-corner-tr { top: 6px; right: 6px; transform: scaleX(-1); }
.t1-corner-bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.t1-corner-br { bottom: 6px; right: 6px; transform: scale(-1, -1); }

.t1-content {
    position: relative;
    z-index: 1;
    padding: 28px 40px;
}

.t1-ganesh-icon {
    text-align: center;
    margin-bottom: 4px;
}

.t1-ganesh-icon svg {
    width: 52px;
    height: 52px;
}

.t1-header-text {
    text-align: center;
    margin-bottom: 4px;
}

.t1-header-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a7a6d;
    letter-spacing: 1px;
}

.t1-header-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 800;
    color: #1a3a5c;
    margin-top: 2px;
}

.t1-personal-section {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}

.t1-details-left {
    flex: 1;
}

.t1-photo-right {
    width: 140px;
    height: 170px;
    border: 2px solid #1a7a6d;
    overflow: hidden;
    flex-shrink: 0;
    background: #e8e0cc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t1-photo-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t1-photo-placeholder {
    color: #999;
    font-size: 40px;
    text-align: center;
}

.t1-field-row {
    display: flex;
    align-items: flex-start;
    padding: 3px 0;
    font-size: 13px;
    line-height: 1.4;
}

.t1-field-label {
    width: 120px;
    min-width: 120px;
    font-weight: 600;
    color: #1a3a5c;
}

.t1-field-colon {
    width: 20px;
    text-align: center;
    color: #1a3a5c;
    font-weight: 600;
}

.t1-field-value {
    flex: 1;
    color: #333;
}

.t1-section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 800;
    color: #1a3a5c;
    text-align: center;
    margin: 14px 0 8px;
}

.t1-divider {
    border: none;
    border-top: 1px solid #1a7a6d;
    margin: 10px 0;
    opacity: 0.3;
}

/* ============================================
   TEMPLATE 2: FLORAL PINK
   Light pink background, colorful flowers,
   photo at top center
   ============================================ */
.template-2 {
    background: #fdf0ee;
    padding: 0;
    position: relative;
}

.t2-content {
    position: relative;
    z-index: 1;
    padding: 20px 50px;
}

.t2-photo-top {
    width: 150px;
    height: 180px;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 3px solid #c07830;
    background: #e8d8d0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t2-photo-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t2-photo-placeholder {
    color: #c0a080;
    font-size: 48px;
}

.t2-section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 800;
    color: #8B4513;
    text-align: center;
    margin: 16px 0 12px;
    letter-spacing: 1.5px;
}

.t2-field-row {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    font-size: 13.5px;
    line-height: 1.5;
}

.t2-field-label {
    width: 175px;
    min-width: 175px;
    font-weight: 500;
    color: #7a5230;
    font-style: italic;
}

.t2-field-colon {
    width: 20px;
    text-align: center;
    color: #7a5230;
}

.t2-field-value {
    flex: 1;
    color: #5a3a1a;
}

/* Floral decorative corners - SVG driven */
.t2-floral-corner {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.t2-floral-tl { top: 0; left: 0; width: 120px; height: 120px; }
.t2-floral-tr { top: 0; right: 0; width: 120px; height: 120px; transform: scaleX(-1); }
.t2-floral-bl { bottom: 0; left: 0; width: 140px; height: 140px; transform: scaleY(-1); }
.t2-floral-br { bottom: 0; right: 0; width: 140px; height: 140px; transform: scale(-1, -1); }

/* Side decorative elements */
.t2-side-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
}

.t2-side-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) scaleX(-1);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   TEMPLATE 3: GOLD CLASSIC (WITH PHOTO)
   White bg, gold borders, diamond corners
   ============================================ */
.template-3 {
    background: #ffffff;
    padding: 0;
}

.t3-border-frame {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    border: 3px solid #b8860b;
    pointer-events: none;
}

.t3-border-inner {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid #b8860b;
    pointer-events: none;
}

/* Diamond corner ornaments */
.t3-diamond {
    position: absolute;
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.t3-diamond svg {
    width: 100%;
    height: 100%;
}

.t3-diamond-tl { top: 7px; left: 7px; }
.t3-diamond-tr { top: 7px; right: 7px; }
.t3-diamond-bl { bottom: 7px; left: 7px; }
.t3-diamond-br { bottom: 7px; right: 7px; }

/* Corner scrollwork */
.t3-scroll {
    position: absolute;
    pointer-events: none;
}

.t3-scroll svg {
    width: 100%;
    height: 100%;
}

.t3-scroll-tl { top: 14px; left: 14px; width: 60px; height: 60px; }
.t3-scroll-tr { top: 14px; right: 14px; width: 60px; height: 60px; transform: scaleX(-1); }
.t3-scroll-bl { bottom: 14px; left: 14px; width: 60px; height: 60px; transform: scaleY(-1); }
.t3-scroll-br { bottom: 14px; right: 14px; width: 60px; height: 60px; transform: scale(-1, -1); }

.t3-content {
    position: relative;
    z-index: 1;
    padding: 40px 50px 30px;
}

.t3-header {
    text-align: center;
    margin-bottom: 8px;
}

.t3-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 800;
    color: #b8860b;
    letter-spacing: 2px;
}

.t3-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-top: 2px;
    letter-spacing: 1px;
}

.t3-personal-section {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}

.t3-details-left {
    flex: 1;
}

.t3-photo-right {
    width: 130px;
    height: 150px;
    border: 2px solid #b8860b;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0e8d0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t3-photo-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t3-photo-placeholder-icon {
    color: #b8860b;
    font-size: 48px;
}

.t3-field-row {
    display: flex;
    align-items: flex-start;
    padding: 4.5px 0;
    font-size: 13.5px;
    line-height: 1.4;
}

.t3-field-label {
    width: 130px;
    min-width: 130px;
    font-weight: 600;
    color: #333;
}

.t3-field-colon {
    width: 16px;
    text-align: center;
    color: #333;
}

.t3-field-value {
    flex: 1;
    color: #444;
}

.t3-section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 800;
    color: #b8860b;
    text-align: center;
    margin: 16px 0 10px;
    letter-spacing: 1px;
}

/* ============================================
   TEMPLATE 4: GOLD MINIMAL (NO PHOTO)
   Same gold style but no photo area
   ============================================ */
.template-4 {
    background: #ffffff;
    padding: 0;
}

/* Template 4 reuses most of Template 3 styles with t4- prefix */
.t4-border-frame {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    border: 3px solid #b8860b;
    pointer-events: none;
}

.t4-border-inner {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid #b8860b;
    pointer-events: none;
}

.t4-diamond {
    position: absolute;
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.t4-diamond svg { width: 100%; height: 100%; }
.t4-diamond-tl { top: 7px; left: 7px; }
.t4-diamond-tr { top: 7px; right: 7px; }
.t4-diamond-bl { bottom: 7px; left: 7px; }
.t4-diamond-br { bottom: 7px; right: 7px; }

.t4-scroll {
    position: absolute;
    pointer-events: none;
}

.t4-scroll svg { width: 100%; height: 100%; }
.t4-scroll-tl { top: 14px; left: 14px; width: 60px; height: 60px; }
.t4-scroll-tr { top: 14px; right: 14px; width: 60px; height: 60px; transform: scaleX(-1); }
.t4-scroll-bl { bottom: 14px; left: 14px; width: 60px; height: 60px; transform: scaleY(-1); }
.t4-scroll-br { bottom: 14px; right: 14px; width: 60px; height: 60px; transform: scale(-1, -1); }

.t4-content {
    position: relative;
    z-index: 1;
    padding: 40px 50px 30px;
}

.t4-header {
    text-align: center;
    margin-bottom: 8px;
}

.t4-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 800;
    color: #b8860b;
    letter-spacing: 2px;
}

.t4-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-top: 2px;
    letter-spacing: 1px;
}

.t4-field-row {
    display: flex;
    align-items: flex-start;
    padding: 5.5px 0;
    font-size: 14px;
    line-height: 1.5;
}

.t4-field-label {
    width: 140px;
    min-width: 140px;
    font-weight: 600;
    color: #333;
}

.t4-field-colon {
    width: 16px;
    text-align: center;
    color: #333;
}

.t4-field-value {
    flex: 1;
    color: #444;
}

.t4-section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 800;
    color: #b8860b;
    text-align: center;
    margin: 20px 0 12px;
    letter-spacing: 1px;
}

/* ============================================
   TEMPLATE 5: ART DECO
   Beige bg, olive/brown geometric 
   corner pieces, art deco patterns
   ============================================ */
.template-5 {
    background: #f5f0e0;
    padding: 0;
}

.t5-border-frame {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    border: 2px solid #8a7a5a;
    pointer-events: none;
}

.t5-border-inner {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid #8a7a5a;
    pointer-events: none;
    opacity: 0.5;
}

/* Art Deco corner ornaments */
.t5-deco-corner {
    position: absolute;
    pointer-events: none;
}

.t5-deco-corner svg {
    width: 100%;
    height: 100%;
}

.t5-deco-tl { top: 8px; left: 8px; width: 50px; height: 50px; }
.t5-deco-tr { top: 8px; right: 8px; width: 50px; height: 50px; transform: scaleX(-1); }
.t5-deco-bl { bottom: 8px; left: 8px; width: 50px; height: 50px; transform: scaleY(-1); }
.t5-deco-br { bottom: 8px; right: 8px; width: 50px; height: 50px; transform: scale(-1, -1); }

/* Top center ornament */
.t5-top-ornament {
    text-align: center;
    margin-bottom: 4px;
}

.t5-top-ornament svg {
    width: 80px;
    height: 50px;
}

/* Bottom center ornament */
.t5-bottom-ornament {
    text-align: center;
    margin-top: 20px;
}

.t5-bottom-ornament svg {
    width: 60px;
    height: 40px;
}

.t5-content {
    position: relative;
    z-index: 1;
    padding: 32px 50px 24px;
}

.t5-header {
    text-align: center;
    margin-bottom: 6px;
}

.t5-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 800;
    color: #6b5b3e;
    letter-spacing: 2px;
}

.t5-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 700;
    color: #444;
    margin-top: 2px;
    letter-spacing: 1px;
}

.t5-field-row {
    display: flex;
    align-items: flex-start;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.5;
}

.t5-field-label {
    width: 135px;
    min-width: 135px;
    font-weight: 600;
    color: #444;
}

.t5-field-colon {
    width: 20px;
    text-align: center;
    color: #444;
}

.t5-field-value {
    flex: 1;
    color: #333;
}

.t5-section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 800;
    color: #6b5b3e;
    text-align: center;
    margin: 18px 0 10px;
    letter-spacing: 1px;
}

.t5-divider {
    border: none;
    border-top: 1px solid #8a7a5a;
    opacity: 0.3;
    margin: 8px 0;
}

.template-mini-6 {
    background: #fdf5f5;
    border: 2px solid #800000;
}

.template-mini-7 {
    background: #f2fbff;
    border: 2px solid #005a80;
}

.template-mini-8 {
    background: #faf7ff;
    border: 2px solid #6b4c9a;
}

/* ============================================
   TEMPLATE 6: ROYAL MAROON
   ============================================ */
.template-6 {
    background: #fdf5f5;
    padding: 0;
}

.t6-border-frame {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 4px double #800000;
    pointer-events: none;
}

.t6-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
}
.t6-corner svg { width: 100%; height: 100%; }
.t6-corner-tl { top: 10px; left: 10px; }
.t6-corner-tr { top: 10px; right: 10px; transform: scaleX(-1); }
.t6-corner-bl { bottom: 10px; left: 10px; transform: scaleY(-1); }
.t6-corner-br { bottom: 10px; right: 10px; transform: scale(-1, -1); }

.t6-content {
    position: relative;
    z-index: 1;
    padding: 40px 50px;
}

.t6-header {
    text-align: center;
    margin-bottom: 20px;
}

.t6-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 900;
    color: #800000;
    letter-spacing: 3px;
    border-bottom: 2px solid #800000;
    display: inline-block;
    padding-bottom: 4px;
}

.t6-personal-section {
    display: flex;
    gap: 24px;
    margin-bottom: 10px;
}

.t6-photo-right {
    width: 130px;
    height: 160px;
    border: 3px solid #800000;
    border-radius: 8px 30px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eedddd;
    display: flex;
    align-items: center;
    justify-content: center;
}
.t6-photo-right img { width: 100%; height: 100%; object-fit: cover; }
.t6-photo-placeholder { color: #800000; font-size: 48px; opacity: 0.5; }

.t6-field-row {
    display: flex;
    align-items: flex-start;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}
.t6-field-label { width: 140px; min-width: 140px; font-weight: 700; color: #800000; }
.t6-field-colon { width: 20px; text-align: center; color: #800000; }
.t6-field-value { flex: 1; color: #333; }

.t6-section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 800;
    color: #800000;
    text-align: left;
    margin: 15px 0 10px;
    border-bottom: 1px dashed #800000;
    padding-bottom: 4px;
}

/* ============================================
   TEMPLATE 7: PEACOCK BLUE
   ============================================ */
.template-7 {
    background: #f2fbff;
    padding: 0;
}

.t7-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, #005a80, #008ba3);
    border-bottom-left-radius: 50% 20px;
    border-bottom-right-radius: 50% 20px;
    z-index: 0;
}

.t7-content {
    position: relative;
    z-index: 1;
    padding: 30px 45px;
}

.t7-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}
.t7-header h2 {
    font-family: 'Noto Serif', serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
}

.t7-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: -30px auto 20px;
    overflow: hidden;
    background: #e0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.t7-photo img { width: 100%; height: 100%; object-fit: cover; }
.t7-photo-placeholder { color: #005a80; font-size: 50px; opacity: 0.6; }

.t7-field-row {
    display: flex;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 13.5px;
    border-bottom: 1px solid rgba(0,90,128,0.1);
}
.t7-field-label { width: 150px; min-width: 150px; font-weight: 600; color: #005a80; }
.t7-field-colon { width: 20px; text-align: center; color: #005a80; }
.t7-field-value { flex: 1; color: #222; }

.t7-section-heading {
    font-family: 'Noto Serif', serif;
    font-size: 18px;
    font-weight: 700;
    color: white;
    background: #005a80;
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    margin: 20px 0 10px;
}

/* ============================================
   TEMPLATE 8: ELEGANT LAVENDER
   ============================================ */
.template-8 {
    background: #faf7ff;
    padding: 0;
    border: 15px solid #eae0ff;
}

.t8-content {
    padding: 30px 40px;
}

.t8-header {
    text-align: center;
    margin-bottom: 25px;
}
.t8-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 700;
    color: #6b4c9a;
}

.t8-photo-right {
    float: right;
    width: 120px;
    height: 150px;
    margin: 0 0 10px 20px;
    border: 1px solid #6b4c9a;
    padding: 4px;
    background: white;
}
.t8-photo-right img { width: 100%; height: 100%; object-fit: cover; }
.t8-photo-placeholder { color: #6b4c9a; font-size: 40px; text-align: center; line-height: 140px; opacity: 0.5; }

.t8-field-row {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    font-size: 14px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
}
.t8-field-label { width: 140px; min-width: 140px; font-weight: 600; color: #6b4c9a; }
.t8-field-colon { width: 15px; text-align: center; color: #6b4c9a; }
.t8-field-value { flex: 1; color: #333; }

.t8-section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    color: #4a3070;
    text-align: center;
    margin: 20px 0 10px;
    position: relative;
    clear: both;
}
.t8-section-heading::before,
.t8-section-heading::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #cbb8ea;
}
.t8-section-heading::before { left: 0; }
.t8-section-heading::after { right: 0; }


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .main-content {
        flex-direction: column;
    }

    .form-panel {
        width: 100%;
        min-width: unset;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .preview-panel {
        height: auto;
        position: relative;
        top: 0;
        padding: 24px 16px;
    }

    .btn-toggle-preview {
        display: inline-flex;
    }

    .template-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 650px) {
    .preview-container {
        transform: scale(0.55);
        transform-origin: top center;
    }

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

    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .header-content {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .form-panel {
        padding: 16px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: #fff;
    }

    .app-header,
    .form-panel {
        display: none !important;
    }

    .main-content {
        display: block;
    }

    .preview-panel {
        padding: 0;
        background: none;
        height: auto;
        position: static;
    }

    .preview-container {
        box-shadow: none;
        margin: 0;
    }

    .biodata-page {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
