/* ===================================
   Franchise Certification Page
   =================================== */
:root {
    /* 대리점 (Dealer) */
    --d-navy: #0E1B33;
    --d-navy2: #182D50;
    --d-gold: #C9A84C;
    --d-gold-light: #E4D08E;
    --d-gold-dark: #9A7B2E;
    /* 취급점 (Retailer) */
    --r-dark: #122E33;
    --r-teal: #2A8C82;
    --r-teal-light: #5CC4B8;
    --r-teal-pale: #A3E4DA;
    --r-teal-dark: #1B6960;
}

.cert-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    font-family: 'Noto Sans KR', -apple-system, sans-serif;
}

/* ===================================
   A4 인증서 플레이트 스타일
   =================================== */
.cert-certificate {
    max-width: 760px;
    margin: 0 auto;
    padding: 60px 50px 50px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    min-height: 1040px;
    display: flex;
    flex-direction: column;
}

.cert-certificate::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 4px;
    pointer-events: none;
}

/* 대리점 플레이트 */
.cert-certificate.dealer-cert {
    background: linear-gradient(170deg, #0E1B33 0%, #152848 40%, #1A2F55 100%);
    border: 2px solid var(--d-gold);
}

.cert-certificate.dealer-cert::before {
    border: 1px solid rgba(201, 168, 76, 0.15);
}

.cert-certificate.dealer-cert::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background:
        radial-gradient(ellipse 400px 600px at 80% 10%, rgba(201, 168, 76, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 300px 400px at 20% 90%, rgba(201, 168, 76, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* 취급점 플레이트 */
.cert-certificate.retailer-cert {
    background: linear-gradient(170deg, #122E33 0%, #163A42 40%, #1A4550 100%);
    border: 2px solid var(--r-teal);
}

.cert-certificate.retailer-cert::before {
    border: 1px solid rgba(42, 140, 130, 0.15);
}

.cert-certificate.retailer-cert::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background:
        radial-gradient(ellipse 400px 600px at 80% 10%, rgba(42, 140, 130, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 300px 400px at 20% 90%, rgba(42, 140, 130, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* 장식선 */
.dealer-cert .cert-header-deco {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--d-gold), transparent);
    margin: 0 auto 20px;
    border-radius: 2px;
}

.retailer-cert .cert-header-deco {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--r-teal-light), transparent);
    margin: 0 auto 20px;
    border-radius: 2px;
}

/* 영문 인증서 타이틀 */
.cert-eng-title {
    text-align: center;
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.25);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.dealer-cert .cert-eng-title {
    color: rgb(201, 168, 76);
    /* 불투명도 1.0 */
}

.retailer-cert .cert-eng-title {
    color: rgb(92, 196, 184);
    /* 불투명도 1.0 */
}

.cert-page h1.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

/* 서명 영역 */
.cert-signature {
    text-align: center;
    margin: auto 0 20px;
    padding-top: 20px;
    position: relative;
    z-index: 1;
}

.dealer-cert .cert-signature {
    border-top: 1px solid rgba(201, 168, 76, 0.2);
}

.retailer-cert .cert-signature {
    border-top: 1px solid rgba(42, 140, 130, 0.2);
}

.dealer-cert .cert-date {
    font-size: 13px;
    color: rgba(201, 168, 76, 0.5);
    margin-bottom: 8px;
}

.retailer-cert .cert-date {
    font-size: 13px;
    color: rgba(92, 196, 184, 0.5);
    margin-bottom: 8px;
}

.dealer-cert .cert-company {
    font-size: 18px;
    font-weight: 700;
    color: var(--d-gold);
    letter-spacing: 3px;
}

.retailer-cert .cert-company {
    font-size: 18px;
    font-weight: 700;
    color: var(--r-teal-light);
    letter-spacing: 3px;
}

/* 인증 상태 */
.cert-status {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.cert-status .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
}

.cert-status .status-badge.valid {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.cert-status .status-badge.expired {
    background: #fff3e0;
    color: #e65100;
    border: 2px solid #ffcc80;
}

.cert-status .status-badge.invalid {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #ef9a9a;
}

/* ===================================
   배너 공통
   =================================== */
.cert-banner-wrap {
    margin-bottom: 30px;
}

.cert-banner-wrap h2 {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.cert-banner {
    width: 100%;
    max-width: 860px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 플레이트 내부 배너 밝은 테두리 (다운로드 시 미반영) */
.cert-certificate .cert-banner {
    outline: 1.5px solid rgba(255, 255, 255, 0.1);
    outline-offset: 0px;
}

/* ===================================
   풀사이즈 배너 (860 × 200)
   =================================== */
/* 대리점 */
.cert-banner.dealer-full {
    height: 200px;
    background: linear-gradient(135deg, var(--d-navy) 0%, var(--d-navy2) 50%, #1F3768 100%);
    display: flex;
    align-items: center;
    padding: 0 48px;
    gap: 28px;
}

.cert-banner.dealer-full::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 300px at 15% 50%, rgba(201, 168, 76, 0.07) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C9A84C' fill-opacity='0.025'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40zm0-40h2l-2 2V0zm0 4l4-4h2l-6 6V4zm0 4l8-8h2L40 10V8zm0 4L52 0h2L40 14v-2zm0 4L56 0h2L40 18v-2zm0 4L60 0h2L40 22v-2z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.cert-banner .left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
    flex-shrink: 0;
}

.dealer-full .logo-ring {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dealer-full .logo-ring img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

/* 취급점 로고 */
.retailer-full .logo-sq {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.retailer-full .logo-sq img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

/* 슬림 배너 로고 */
.logo-sm img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.dealer-full .brand-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    color: rgba(201, 168, 76, 0.6);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.cert-banner .vline {
    width: 1px;
    height: 120px;
    background: linear-gradient(to bottom, transparent, rgba(201, 168, 76, 0.3), transparent);
    flex-shrink: 0;
    z-index: 1;
}

.cert-banner .center {
    flex: 1;
    z-index: 1;
}

.dealer-full .grade-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--d-gold), var(--d-gold-light));
    color: var(--d-navy);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 24px;
    margin-bottom: 10px;
}

.dealer-full .grade-badge svg {
    width: 14px;
    height: 14px;
}

.dealer-full .main-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    color: #fff;
    letter-spacing: 4px;
    line-height: 1;
    margin-bottom: 6px;
}

.dealer-full .main-title em {
    font-style: normal;
    color: var(--d-gold);
}

.dealer-full .sub-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
}

.cert-banner .right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 1;
    flex-shrink: 0;
}

.cert-banner .qr-wrap {
    padding: 6px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.dealer-full .qr-wrap::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 10px;
    pointer-events: none;
}

.dealer-full .scan-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 7px;
    letter-spacing: 2px;
    color: rgba(201, 168, 76, 0.5);
    text-transform: uppercase;
}

.cert-banner .cert-id {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    letter-spacing: 1px;
}

.dealer-full .cert-id {
    color: rgba(201, 168, 76, 0.4);
}

/* ===================================
   취급점 풀사이즈 배너
   =================================== */
.cert-banner.retailer-full {
    height: 200px;
    background: linear-gradient(135deg, var(--r-dark) 0%, #1A4048 50%, #1E5A5A 100%);
    display: flex;
    align-items: center;
    padding: 0 48px;
    gap: 28px;
}

.cert-banner.retailer-full::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 500px 250px at 85% 50%, rgba(42, 140, 130, 0.06) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%232A8C82' fill-opacity='0.04' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.retailer-full .logo-sq {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.retailer-full .logo-sq span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    color: var(--r-teal-light);
    font-weight: 700;
}

.retailer-full .brand-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    color: rgba(92, 196, 184, 0.5);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.retailer-full .vline {
    background: linear-gradient(to bottom, transparent, rgba(92, 196, 184, 0.25), transparent);
}

.retailer-full .grade-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(42, 140, 130, 0.2);
    border: 1.5px solid rgba(92, 196, 184, 0.3);
    color: var(--r-teal-pale);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.retailer-full .grade-badge svg {
    width: 13px;
    height: 13px;
}

.retailer-full .main-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 34px;
    color: #fff;
    letter-spacing: 3px;
    line-height: 1;
    margin-bottom: 6px;
}

.retailer-full .main-title em {
    font-style: normal;
    color: var(--r-teal-light);
}

.retailer-full .sub-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
}

.retailer-full .qr-wrap::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 1px solid rgba(92, 196, 184, 0.2);
    border-radius: 10px;
    pointer-events: none;
}

.retailer-full .scan-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 7px;
    letter-spacing: 2px;
    color: rgba(92, 196, 184, 0.45);
    text-transform: uppercase;
}

.retailer-full .cert-id {
    color: rgba(92, 196, 184, 0.35);
}

/* ===================================
   슬림 스트립 (860 × 80)
   =================================== */
.cert-banner.dealer-strip {
    height: 80px;
    background: linear-gradient(135deg, var(--d-navy) 0%, var(--d-navy2) 100%);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
}

.dealer-strip .logo-sm {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.dealer-strip .logo-sm span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    color: var(--d-gold);
    font-weight: 700;
}

.cert-banner .sep {
    width: 1px;
    height: 40px;
    flex-shrink: 0;
    z-index: 1;
}

.dealer-strip .sep {
    background: linear-gradient(to bottom, transparent, rgba(201, 168, 76, 0.3), transparent);
}

.cert-banner .strip-info {
    flex: 1;
    z-index: 1;
}

.dealer-strip .strip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--d-gold), var(--d-gold-light));
    color: var(--d-navy);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 4px;
}

.dealer-strip .strip-badge svg {
    width: 9px;
    height: 9px;
}

.dealer-strip .strip-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.dealer-strip .strip-title em {
    font-style: normal;
    color: var(--d-gold);
}

.cert-banner .strip-right {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    flex-shrink: 0;
}

.cert-banner .strip-cert {
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    letter-spacing: 0.8px;
    text-align: right;
    line-height: 1.5;
}

.dealer-strip .strip-cert {
    color: rgba(201, 168, 76, 0.4);
}

.cert-banner .qr-mini {
    padding: 4px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
}

/* 취급점 스트립 */
.cert-banner.retailer-strip {
    height: 80px;
    background: linear-gradient(135deg, var(--r-dark) 0%, #1A4048 100%);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
}

.retailer-strip .logo-sm {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.retailer-strip .logo-sm span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    color: var(--r-teal-light);
    font-weight: 700;
}

.retailer-strip .sep {
    background: linear-gradient(to bottom, transparent, rgba(92, 196, 184, 0.25), transparent);
}

.retailer-strip .strip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(42, 140, 130, 0.18);
    border: 1px solid rgba(92, 196, 184, 0.3);
    color: var(--r-teal-pale);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.retailer-strip .strip-badge svg {
    width: 9px;
    height: 9px;
}

.retailer-strip .strip-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.retailer-strip .strip-title em {
    font-style: normal;
    color: var(--r-teal-light);
}

.retailer-strip .strip-cert {
    color: rgba(92, 196, 184, 0.35);
}

/* ===================================
   가맹점 정보 카드
   =================================== */
.cert-info-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.cert-info-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.cert-info-card dl {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px 16px;
}

.cert-info-card dt {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
}

.cert-info-card dd {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* ===================================
   다운로드 버튼
   =================================== */
/* 플레이트 외부 다운로드 섹션 */
.cert-download-section.outside {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    max-width: 760px;
    margin: 24px auto 0;
    padding: 30px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.cert-download-section.outside h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
}

.cert-download-section.outside .cert-download-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.cert-download-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cert-download-btns.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-download.dealer {
    background: var(--d-navy);
    color: var(--d-gold);
}

.btn-download.dealer:hover {
    background: var(--d-navy2);
}

.btn-download.retailer {
    background: var(--r-dark);
    color: var(--r-teal-light);
}

.btn-download.retailer:hover {
    background: #1A4048;
}

/* ===================================
   만료/무효 상태 카드
   =================================== */
.cert-expired-card,
.cert-invalid-card {
    text-align: center;
    padding: 60px 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.cert-expired-card .icon,
.cert-invalid-card .icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.cert-expired-card h2 {
    color: #e65100;
}

.cert-invalid-card h2 {
    color: #c62828;
}

.cert-expired-card p,
.cert-invalid-card p {
    font-size: 15px;
    color: #666;
    margin-top: 10px;
}

.cert-back-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background: #333;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.cert-back-link:hover {
    background: #555;
    color: #fff;
}

/* ===================================
   반응형
   =================================== */
@media (max-width: 640px) {
    .cert-page {
        padding: 20px 10px 40px;
    }

    .cert-banner.dealer-full,
    .cert-banner.retailer-full {
        height: auto;
        flex-direction: column;
        padding: 28px 24px;
        gap: 16px;
        text-align: center;
    }

    .cert-banner .left {
        flex-direction: row;
        gap: 14px;
    }

    .cert-banner .vline {
        width: 60%;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(201, 168, 76, 0.2), transparent);
    }

    .retailer-full .vline {
        background: linear-gradient(to right, transparent, rgba(92, 196, 184, 0.2), transparent);
    }

    .cert-banner .center {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .dealer-full .main-title {
        font-size: 26px;
        letter-spacing: 3px;
    }

    .retailer-full .main-title {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .cert-banner .right {
        flex-direction: row;
        gap: 12px;
        align-items: center;
    }

    .cert-banner.dealer-strip,
    .cert-banner.retailer-strip {
        height: auto;
        flex-wrap: wrap;
        padding: 16px 20px;
        gap: 10px;
    }

    .cert-banner .strip-right {
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 10px;
    }

    .cert-info-card dl {
        grid-template-columns: 1fr;
    }

    .cert-download-section.outside {
        display: none;
    }
}