:root {
    --primary-green: #006400; /* Telangana Dark Green */
    --accent-gold: #FFD700;
    --accent-orange: #FF8C00;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-dark: #333;
    --text-muted: #666;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    margin: 0;
    color: var(--text-dark);
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

header {
    text-align: center;
    background: white;
    padding: 1rem 0.5rem;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

.official-photos {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 0 10px;
}

.official-card {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.official-card img {
    width: 80px;
    height: 80px;
    object-fit: cover; /* Square original format */
    border-radius: 4px; /* Light square border instead of circle */
    border: 2px solid var(--primary-green);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background: white;
}

.official-card .name {
    font-weight: bold;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--primary-green);
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.official-card .title {
    font-size: 0.65rem;
    color: #555;
    line-height: 1.1;
    margin-top: 2px;
}

.telangana-logo {
    width: 105px !important;
    height: 105px !important;
    object-fit: contain;
    margin: 0 !important;
    border-radius: 50% !important;
    border: 2px solid var(--primary-green) !important;
}

.cce-logo-round {
    width: 105px !important;
    height: 105px !important;
    object-fit: contain;
    margin: 0 !important;
    border-radius: 50% !important;
    border: 2px solid var(--primary-green) !important;
}

.main-titles {
    margin-top: 1rem;
}

.main-titles h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary-green);
    text-transform: uppercase;
}

.main-titles h2 {
    margin: 0.5rem 0;
    font-size: 1.5rem;
    color: var(--accent-orange);
}

.main-titles h3 {
    margin: 0;
    font-size: 1rem;
    color: #444;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

.step-card {
    border-left: 5px solid var(--primary-green);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.step-card h4 {
    margin-top: 0;
    color: var(--primary-green);
    font-size: 1.2rem;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

select, input, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--primary-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.principal-info {
    background: #f0f4f0;
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px dashed var(--primary-green);
    margin-bottom: 1.5rem;
    display: none;
}

.principal-info p {
    margin: 0.3rem 0;
    font-size: 0.95rem;
}

.btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background: #004d00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #666;
}

.btn-secondary:hover {
    background: #444;
}

.hidden {
    display: none;
}

.footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* OTP Modal */
#otp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#otp-modal.active {
    opacity: 1;
    visibility: visible;
}

#otp-modal .modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    width: 380px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

/* Sub-form animation */
#detailed-form {
    animation: slideUp 0.5s ease;
}

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

/* Row-based layout for large forms */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

@media (max-width: 600px) {
    .official-photos { flex-direction: column; align-items: center; }
    .form-row { flex-direction: column; gap: 0; }
}

/* Print Specific Rules for Letterhead Formatting */
.print-only { display: none; }

@media print {
    .print-only { display: block !important; }
    .screen-only { display: none !important; }
    
    body { background: white; margin: 0; padding: 0; }
    
    /* Reset layout constraints for full page print */
    .container, .card, .step-card {
        max-width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide the non-printable stuff: headers, footers, forms, steps */
    header, .footer, #step-1, #detailed-form, #otp-modal {
        display: none !important;
    }
    
    /* Make the success screen take over the whole page cleanly */
    #success-screen {
        display: block !important;
        background: white !important;
        margin: 0 !important; 
        padding: 0 !important;
        box-shadow: none !important; 
        border: none !important;
    }
    
    /* Hide success messages and buttons inside success screen */
    #success-screen > .step-card > h4, 
    #success-screen p.screen-only {
        display: none !important;
    }
    #success-screen .btn {
        display: none !important;
    }
    
    /* Only show the summary area */
    #submitted-summary {
        display: block !important;
        border: none !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Force compact line spacing explicitly for paragraphs inside the summary list to fit 1 sheet */
    #print-data-list p {
        margin: 3px 0 !important;
    }
}
