:root {
    /* Exact Indian Flag Colors */
    --saffron: #FF671F;
    --green: #046A38;
    --navy: #06038D;
    
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --input-bg: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    /* Soft, patriotic animated background */
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 50%, #e8f5e9 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    
    /* Patriotic Accents */
    border-top: 5px solid var(--saffron);
    border-bottom: 5px solid var(--green);
    
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

/* Little flag emoji animation at the top */
.glass-card::before {
    content: '🇮🇳';
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
    animation: wave 2s infinite ease-in-out;
    transform-origin: bottom center;
}

@keyframes wave {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(10deg); }
}

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

h1 {
    font-weight: 800;
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--navy);
    letter-spacing: -0.5px;
}

p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 16px 20px;
    background: var(--input-bg);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

input:focus {
    border-color: var(--saffron);
    box-shadow: 0 0 0 4px rgba(255, 103, 31, 0.15);
}

.hint-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: left;
    padding-left: 4px;
}

.preview-wrapper {
    margin-bottom: 20px;
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-align: left;
    padding-left: 4px;
}

#certCanvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #f8fafc;
}

button {
    width: 100%;
    padding: 16px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 6px rgba(6, 3, 141, 0.15);
}

button:hover {
    background: #040263;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 3, 141, 0.25);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none !important;
}

#message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.success {
    background: rgba(4, 106, 56, 0.1);
    color: var(--green);
    border: 1px solid rgba(4, 106, 56, 0.2);
}

.error {
    background: rgba(255, 103, 31, 0.1);
    color: #e65c1c;
    border: 1px solid rgba(255, 103, 31, 0.2);
}

/* Simple CSS Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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