:root {
    --oily-green: #2d5016;
    --oily-golden: #b8860b;
    --dark-text: #1a1a1a;
    --light-bg: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #e9ecef;
    color: var(--dark-text);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-text {
    font-family: 'Poppins', sans-serif;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Controls Panel --- */
.controls-panel {
    width: 420px;
    background: #fff;
    padding: 2.5rem 2rem;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
}

.brand-header {
    color: var(--oily-green);
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--oily-golden);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(184, 134, 11, 0.2);
    padding-bottom: 6px;
}

.form-label {
    font-weight: 600;
    color: var(--oily-green);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-control,
.form-select {
    border: 2px solid #eaeaea;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: var(--light-bg);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--oily-golden);
    background-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(184, 134, 11, 0.1);
    outline: none;
}

.btn-generate {
    background-color: var(--oily-green);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.2);
}

.btn-generate:hover {
    background-color: #1a300d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 80, 22, 0.3);
}

.btn-theme {
    background-color: white;
    color: var(--oily-golden);
    border: 2px solid var(--oily-golden);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-theme:hover {
    background-color: var(--oily-golden);
    color: white;
}

/* --- Preview Panel & A4 Settings --- */
.preview-panel {
    flex-grow: 1;
    margin-left: 420px;
    padding: 3rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-image: radial-gradient(#cbd2d9 1px, transparent 1px);
    background-size: 25px 25px;
}

.a4-wrapper {
    width: 794px;
    /* Exact 210mm at 96 DPI */
    height: 1123px;
    /* Exact 297mm at 96 DPI */
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transform-origin: top center;
}

.pdf-capture-area {
    width: 794px;
    height: 1123px;
    position: relative;
    background: #ffffff;
    overflow: hidden;
    box-sizing: border-box;
}

/* --- PREMIUM DESIGN ELEMENTS --- */

/* Watermark */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 4rem;
    font-weight: 900;
    color: rgba(184, 134, 11, 0.08);
    text-transform: uppercase;
    letter-spacing: 8px;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
}

/* Decorative Background Accents */
.bg-accent-blob {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(184, 134, 11, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: 1;
}

.bg-accent-blob.blob-2 {
    top: auto;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(45, 80, 22, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
}

.side-accent-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(180deg, var(--oily-green) 0%, var(--oily-golden) 100%);
    z-index: 5;
}

/* Page Constraints */
.page-content {
    position: absolute;
    top: 45px;
    right: 45px;
    bottom: 45px;
    left: 60px;
    /* offset for side bar */
    z-index: 10;
    display: flex;
    flex-direction: column;
}

/* Optional Classic Theme overlay */
.theme-classic .side-accent-bar {
    display: none;
}

.theme-classic::after {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    border: 3px solid var(--oily-green);
    pointer-events: none;
    z-index: 4;
}

.theme-classic::before {
    content: '';
    position: absolute;
    top: 36px;
    left: 36px;
    right: 36px;
    bottom: 36px;
    border: 1px solid var(--oily-golden);
    pointer-events: none;
    z-index: 4;
}

.theme-classic .page-content {
    left: 60px;
    right: 60px;
    top: 60px;
    bottom: 60px;
}


/* --- HEADER --- */
.top-header {
    display: flex;
    justify-content: center;
    /* Center since we dropped contact info from header */
    align-items: center;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo-img {
    display: block;
    height: 55px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.brand-text {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.brand-text .p1 {
    color: var(--oily-green);
}

.brand-text .p2 {
    color: var(--oily-golden);
}

/* --- CORE INFO (Center) --- */
.center-core {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 10px;
}

.doc-badge {
    background-color: rgba(184, 134, 11, 0.1);
    color: var(--oily-golden);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    border: 1px solid rgba(184, 134, 11, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.main-subject-title {
    font-size: 4.8rem;
    font-weight: 900;
    color: var(--oily-green);
    line-height: 1.15;
    margin-bottom: 25px;
    text-transform: capitalize;
    letter-spacing: -1px;
    max-width: 100%;
    word-wrap: break-word;
}

.code-pill {
    font-size: 1.4rem;
    font-weight: 600;
    color: #666;
    background: #f4f6f8;
    padding: 10px 25px;
    border-radius: 8px;
    border-left: 6px solid var(--oily-golden);
    display: flex;
    align-items: center;
    gap: 15px;
}

.code-pill .code-val {
    color: var(--dark-text);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.subtitle-text {
    font-size: 1.8rem;
    color: #555;
    font-weight: 500;
    margin-top: 35px;
    font-family: 'Inter', sans-serif;
}

/* --- BOTTOM CONTACT CARD (Replaces metadata) --- */
.bottom-metadata {
    margin-top: auto;
    padding-bottom: 30px;
}

.contact-card {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(45, 80, 22, 0.1);
    border-radius: 16px;
    padding: 30px;
}

.contact-card h4 {
    font-size: 1.1rem;
    color: #777;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- PREMIUM FOOTER --- */
.premium-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    opacity: 0.6;
}

.premium-footer .line {
    flex-grow: 1;
    height: 1px;
    background: var(--oily-green);
}

.premium-footer .f-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--oily-green);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Responsive Scaling purely for Web View */
@media (max-width: 1300px) {
    .a4-wrapper {
        transform: scale(0.75);
    }
}

@media (max-width: 1100px) {
    .app-container {
        flex-direction: column;
    }

    .controls-panel {
        width: 100%;
        height: auto;
        position: relative;
    }

    .preview-panel {
        margin-left: 0;
        padding: 2rem 0;
    }

    .a4-wrapper {
        transform: scale(0.65);
    }
}

@media (max-width: 600px) {
    .a4-wrapper {
        transform: scale(0.4);
        margin-top: -150px;
        margin-bottom: -250px;
    }
}