* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hind Siliguri', sans-serif;
}

body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    display: flex;
    gap: 30px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 100%;
}

.sidebar {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar h2 {
    color: #061d4b;
    margin-bottom: 10px;
}

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

.form-group label {
    font-weight: 600;
    color: #444;
}

.form-group input {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #061d4b;
}

.download-btn {
    margin-top: auto;
    padding: 15px;
    background: #061d4b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

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

.preview-area {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Certificate Styles */
.certificate {
    position: relative;
    width: 600px;
    height: 656.5px;
    background-image: url('image/school.png');
    background-size: 100% 100%;
    /* Force exact stretch to avoid cropping */
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Overlays */
.overlay-profile-outer {
    position: absolute;
    top: 29.6%;
    /* Precisely aligned to the original photo */
    left: 50%;
    transform: translateX(-50%);
    width: 270px;
    height: 270px;
    border-radius: 50%;
    background-color: #1565C0;          /* vivid royal blue outer ring */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay-profile {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background-color: #3498db;
    /* Default bg if no image */
    border: 5px solid #ffffff;          /* white inner gap */
    overflow: hidden;
    background-size: cover;
    background-position: center;
}


/* ── Medal Badge ── */
.overlay-badge {
    position: absolute;
    top: 31%;
    right: 11%;
    width: 130px;
    height: 210px;
    z-index: 15;
}

.badge-svg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: block;
}

/* Text sits centered on the gold circle (medal center = 65px from top) */
.badge-content {
    position: absolute;
    top: 65px;
    left: 65px;
    transform: translate(-50%, -50%);
    width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2;
}

.badge-title {
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    color: #0d2260;
}

.badge-number {
    color: #c0180c;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
}

.badge-stars {
    color: #0d2260;
    font-size: 11px;
    letter-spacing: 2px;
}


.overlay-name {
    position: absolute;
    bottom: 11%;
    left: 50%;
    transform: translateX(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='330' height='42' viewBox='0 0 330 42'%3E%3Crect width='330' height='42' rx='12' fill='%23061d4b'/%3E%3Cpath d='M11 3h308a8 8 0 0 0 8 8v20a8 8 0 0 0-8 8H11a8 8 0 0 0-8-8V11a8 8 0 0 0 8-8z' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    color: white;
    font-size: 22px;
    font-weight: 700;
    width: 55.1%;
    padding: 0 20px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: none;
    z-index: 10;
    text-align: center;
    white-space: nowrap;
}

.overlay-bottom-info {
    position: absolute;
    bottom: 1.3%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #FEFEFE;
    border-radius: 16px;
    width: 55.1%;
    /* 342px */
    height: 58px;
    border: 1px solid #012365;
    z-index: 10;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.info-card .icon {
    color: #061d4b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-card .icon svg {
    width: 16px;
    height: 16px;
}

.info-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.info-content .label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    margin-bottom: -2px;
    text-align: center;
}

.info-content .value {
    font-size: 14px;
    color: #061d4b;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.divider {
    width: 2px;
    height: 40px;
    background: #012365;
    opacity: 0.2;
    margin: 0 2rem;
}

@media (max-width: 1100px) {
    .container { gap: 20px; padding: 20px; }
    .sidebar { min-width: 260px; }
}

/* Tablet: stack vertically */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }
    .sidebar {
        width: 100%;
        min-width: unset;
        max-width: 560px;
    }
    .preview-area {
        width: 100%;
        display: flex;
        justify-content: center;
        overflow: visible;
    }
    .certificate-scaler {
        transform-origin: top center;
        transform: scale(0.85);
        margin-bottom: -98px;
    }
}

@media (max-width: 680px) {
    .certificate-scaler {
        transform: scale(0.65);
        margin-bottom: -230px;
    }
}

@media (max-width: 500px) {
    body { padding: 10px; }
    .container { padding: 15px; border-radius: 8px; }
    .form-group input { font-size: 14px; padding: 10px; }
    .download-btn { font-size: 16px; padding: 12px; }
    .certificate-scaler {
        transform: scale(0.48);
        margin-bottom: -342px;
    }
}

@media (max-width: 360px) {
    .certificate-scaler {
        transform: scale(0.38);
        margin-bottom: -408px;
    }
}