@font-face {
    font-family: 'DBAdmanX';
    src: url('../fonts/db_adman_x.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'DBAdmanX', 'Segoe UI', Tahoma, sans-serif;
    font-size: 18px;
    line-height: 1.45;
    color: #12263f;
    background-color: #eaf3fc;
    background-image: url('../images/background.jpg');
    background-position: center bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

form#form1 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header Bar */
.eco-topbar {
    width: 100%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(183, 206, 232, 0.75);
    box-shadow: 0 2px 14px rgba(11, 57, 107, 0.06);
}

.eco-topbar-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 12px 32px;
    display: grid;
    grid-template-columns: 1fr auto 1.15fr auto 0.9fr;
    align-items: center;
    gap: 24px;
}

.eco-brand-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.eco-logo-sponsor {
    max-height: 62px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.eco-logo-event {
    max-height: 58px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.eco-topbar-divider {
    width: 1.5px;
    height: 50px;
    background: #9fb2c7;
    opacity: 0.75;
}

.eco-topbar-title {
    text-align: center;
    font-size: 1.85rem;
    font-weight: 700;
    color: #0b396b;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Sub-header Ribbon */
.eco-main-wrap {
    flex: 1;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 20px 36px 48px;
    display: flex;
    flex-direction: column;
}

.eco-subbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.eco-subbar-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

.eco-subbar-icon {
    width: 38px;
    height: 38px;
    color: #0b396b;
    flex-shrink: 0;
}

.eco-subbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.eco-subbar-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.65rem;
    font-weight: 600;
    color: #0b396b;
}

.eco-subbar-subtitle {
    font-size: 0.72rem;
    font-style: italic;
    letter-spacing: 0.05em;
    color: #5b718a;
    margin-top: 2px;
}

.eco-subbar-line {
    flex: 1;
    height: 2px;
    background: #6c7f93;
    opacity: 0.75;
    margin-top: 16px;
}

/* Page 1: Selection Card */
.cert-select-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 28px;
}

.cert-select-card {
    width: 100%;
    max-width: 790px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #d5e3f2;
    border-radius: 22px;
    padding: 44px 48px 46px;
    box-shadow: 0 12px 34px rgba(11, 57, 107, 0.09);
}

.cert-card-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #0b396b;
    line-height: 1.25;
}

.cert-card-desc {
    margin: 4px 0 0;
    font-size: 1.08rem;
    color: #4f6378;
}

.cert-card-divider {
    border: 0;
    border-top: 1px solid #d6e2ef;
    margin: 22px 0 54px;
}

.cert-form-group {
    margin-bottom: 48px;
}

.cert-field-label {
    display: inline-block;
    font-size: 1.12rem;
    font-weight: 700;
    color: #0b396b;
    margin-bottom: 10px;
}

.cert-required {
    color: #dc2626;
    margin-left: 3px;
}

.cert-select-wrap {
    position: relative;
}

.cert-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    border: 1.5px solid #c0d2e6;
    border-radius: 12px;
    padding: 13px 46px 13px 18px;
    font-family: inherit;
    font-size: 1.08rem;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cert-select:focus {
    outline: none;
    border-color: #196fd4;
    box-shadow: 0 0 0 4px rgba(25, 111, 212, 0.14);
}

.cert-select-chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #0b396b;
    pointer-events: none;
}

.cert-alert {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 11px 15px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.98rem;
}

.cert-alert.is-visible {
    display: flex;
}

.cert-primary-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, #0b51a3 0%, #1d75d8 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(15, 92, 180, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cert-primary-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 22px rgba(15, 92, 180, 0.32);
    transform: translateY(-1px);
}

.cert-primary-btn:active {
    transform: translateY(0);
}

/* Page 2: Preview & Download Grid */
.cert-download-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
    gap: 28px;
    align-items: start;
}

.cert-preview-card {
    background: rgba(244, 248, 255, 0.94);
    border: 1px solid #d6e3f2;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 12px 32px rgba(11, 57, 107, 0.10);
}

.cert-preview-frame {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.cert-preview-img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

.cert-preview-hint {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 0.88rem;
    color: #5b718a;
}

.cert-details-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #d6e3f2;
    border-radius: 20px;
    padding: 24px 26px 26px;
    box-shadow: 0 12px 30px rgba(11, 57, 107, 0.10);
}

.cert-details-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d7e3f0;
}

.cert-details-icon {
    width: 42px;
    height: 42px;
    color: #0b396b;
    flex-shrink: 0;
}

.cert-details-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0b396b;
    line-height: 1.15;
}

.cert-details-sub {
    font-size: 0.92rem;
    color: #6b7f95;
}

.cert-info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 22px;
}

.cert-info-table tr {
    border-bottom: 1px solid #e2ebf4;
}

.cert-info-table th {
    width: 36%;
    text-align: left;
    vertical-align: middle;
    padding: 12px 12px;
    background: #eff5fc;
    color: #0b396b;
    font-weight: 700;
    font-size: 0.98rem;
}

.cert-info-table td {
    padding: 12px 14px;
    color: #0f2947;
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
}

.cert-verified-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #eaf7ef;
    border: 1px solid #cbead6;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.cert-verified-icon {
    width: 40px;
    height: 40px;
    color: #2ea44f;
    flex-shrink: 0;
}

.cert-verified-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #167938;
    line-height: 1.2;
}

.cert-verified-desc {
    font-size: 0.88rem;
    color: #4d6275;
    line-height: 1.35;
}

.cert-download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(90deg, #0b51a3 0%, #1d75d8 100%);
    color: #ffffff;
    text-decoration: none;
    font-size: 1.22rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(15, 92, 180, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cert-download-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 22px rgba(15, 92, 180, 0.34);
    transform: translateY(-1px);
}

.cert-download-btn-left {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cert-pdf-badge {
    border: 1.5px solid rgba(255, 255, 255, 0.78);
    border-radius: 7px;
    padding: 3px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.cert-back-row {
    margin-top: 16px;
    text-align: center;
}

.cert-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0b51a3;
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.cert-back-link:hover {
    background-color: rgba(11, 81, 163, 0.08);
}

/* Lightbox Modal */
.cert-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(9, 25, 48, 0.85);
    padding: 24px;
    align-items: center;
    justify-content: center;
}

.cert-lightbox.is-open {
    display: flex;
}

.cert-lightbox-inner {
    position: relative;
    max-width: 1120px;
    max-height: 92vh;
}

.cert-lightbox-img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    display: block;
}

.cert-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #0b396b;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
    .eco-topbar-inner {
        padding: 12px 20px;
        gap: 14px;
    }

    .eco-topbar-title {
        font-size: 1.45rem;
    }

    .eco-main-wrap {
        padding: 18px 20px 36px;
    }

    .cert-download-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .eco-topbar-inner {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 16px;
        text-align: center;
    }

    .eco-topbar-divider {
        display: none;
    }

    .eco-logo-sponsor {
        max-height: 48px;
    }

    .eco-logo-event {
        max-height: 46px;
    }

    .eco-topbar-title {
        font-size: 1.35rem;
        padding-top: 4px;
        border-top: 1px solid #e2ebf4;
    }

    .eco-main-wrap {
        padding: 14px 14px 28px;
    }

    .eco-subbar {
        margin-bottom: 18px;
    }

    .eco-subbar-title {
        font-size: 1.35rem;
    }

    .cert-select-card {
        padding: 28px 20px 30px;
        border-radius: 16px;
    }

    .cert-card-title {
        font-size: 1.55rem;
    }

    .cert-card-divider {
        margin: 16px 0 28px;
    }

    .cert-form-group {
        margin-bottom: 28px;
    }

    .cert-preview-card {
        padding: 12px;
        border-radius: 16px;
    }

    .cert-details-card {
        padding: 20px 18px;
        border-radius: 16px;
    }

    .cert-info-table th {
        width: 40%;
        padding: 10px 8px;
        font-size: 0.92rem;
    }

    .cert-info-table td {
        padding: 10px 10px;
        font-size: 0.95rem;
    }
}