:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #333;
    --text-muted: #666;
    --success: #2ecc71;
    --gold: #d4af37;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, .cert-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
}

/* Overlay for Music Autoplay */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(44, 62, 80, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.overlay-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.overlay-content h2 { margin-bottom: 1rem; }
.overlay-content p { margin-bottom: 2rem; }

/* Container & Cards */
.container {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeInUp 1s ease forwards;
}

.step {
    display: none;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: flex !important;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* Header */
.gov-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gold);
}

.seal {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: spin 10s linear infinite;
}

.gov-header h1 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gov-header h3 {
    font-weight: 300;
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Welcome Section */
.welcome-section h2 {
    font-size: 1.8rem;
    min-height: 2.5rem; /* for typewriter */
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.application-details {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.9);
}

.status-pending {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.details-grid label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.details-grid p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Lists */
.reason-list {
    list-style: none;
    margin-top: 1rem;
}

.reason-list li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
}

/* Progress Bars */
.progress-container {
    margin-top: 1.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 0; /* Animated in JS */
    border-radius: 5px;
    transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.infinite-love {
    background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 100%);
    box-shadow: 0 0 10px #ff7eb3;
}

/* Checkboxes */
.checklist {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    cursor: default;
}

.check-item input {
    width: 20px;
    height: 20px;
    accent-color: var(--secondary-color);
}

/* Final Question */
.final-question-section {
    text-align: center;
    background: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255, 235, 238, 0.9));
    border: 2px solid var(--secondary-color);
}

.question-text {
    font-size: 1.5rem;
    margin: 1.5rem 0;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--primary-color);
    color: white;
}

.btn-yes {
    background: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-yes:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* Success Screen */
.success-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

.success-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
    animation: fadeIn 1s ease;
}

.success-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.success-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Certificate */
.certificate-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.certificate {
    background: linear-gradient(135deg, #fdfbf7 0%, #fff9f0 100%);
    width: 100%;
    max-width: 700px;
    padding: 2.5rem;
    box-shadow: 0 15px 40px rgba(231, 76, 60, 0.2), 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    color: #2c3e50;
    border-radius: 4px;
}

.certificate::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><g fill="rgba(212, 175, 55, 0.05)"><path d="M50 0 L100 50 L50 100 L0 50 Z" /></g></svg>');
    opacity: 0.5;
    z-index: 0;
}

.cert-border {
    border: 4px solid var(--gold);
    outline: 2px solid var(--gold);
    outline-offset: 8px;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.92);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.2);
}

.cert-header {
    margin-bottom: 2rem;
}

.cert-title {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.cert-subtitle {
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-style: italic;
}

.cert-body {
    margin: 2rem 0;
}

.cert-text {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.cert-names {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin: 0.5rem 0;
    font-family: 'Great Vibes', cursive;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(231, 76, 60, 0.2);
}

.cert-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15rem;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

/* Ribbon styling */
.ribbon {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 150px;
    height: 150px;
    overflow: hidden;
    z-index: 10;
}

.ribbon span {
    position: absolute;
    display: block;
    width: 225px;
    padding: 10px 0;
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    text-transform: uppercase;
    text-align: center;
    left: -20px;
    top: 35px;
    transform: rotate(45deg);
    font-weight: 600;
    letter-spacing: 2px;
    font-family: 'Poppins', sans-serif;
}

.ribbon::before, .ribbon::after {
    content: '';
    position: absolute;
    z-index: -1;
    border: 5px solid #a31c1c;
}

.ribbon::before {
    top: 0;
    right: 48px;
    border-top-color: transparent;
    border-right-color: transparent;
}

.ribbon::after {
    bottom: 48px;
    right: 0;
    border-bottom-color: transparent;
    border-right-color: transparent;
}

.cert-details {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
    font-size: 0.9rem;
    background: rgba(212, 175, 55, 0.1);
    padding: 1rem;
    border-radius: 8px;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 3rem;
}

.signature {
    width: 200px;
}

.handwriting {
    font-family: 'Brush Script MT', cursive;
    font-size: 2rem;
    color: #333;
}

.signature hr {
    border: 0;
    border-bottom: 1px solid #333;
    margin: 5px 0;
}

.seal-bottom {
    font-size: 4rem;
    color: var(--secondary-color);
    opacity: 0.8;
}

.btn-download {
    background: var(--gold);
    color: #fff;
}

.btn-download:hover {
    background: #b8962e;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes bounceIn {
    0% { transform: scale(0.1); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

.bounce-in {
    animation: bounceIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite both;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes heartbeat {
    from { transform: scale(1); transform-origin: center center; animation-timing-function: ease-out; }
    10% { transform: scale(0.91); animation-timing-function: ease-in; }
    17% { transform: scale(0.98); animation-timing-function: ease-out; }
    33% { transform: scale(0.87); animation-timing-function: ease-in; }
    45% { transform: scale(1); animation-timing-function: ease-out; }
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

@media (max-width: 600px) {
    .cert-footer { flex-direction: column; align-items: center; gap: 2rem; }
    .cert-details { flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; }
    .gov-header h1 { font-size: 1.8rem; }
    .cert-title { font-size: 1.8rem; }
    .cert-names { font-size: 1.8rem; }
}
