/* ==================================================
   Certificate Template Preview
   Version: 1.4.0

   Purpose:
   - Certificate Canvas Standard v1.0
   - ISO A4 Landscape Governance Lock
   - AAU Certificate Rendering Standard
================================================== */

:root {
    --cg-border: #e5e7eb;
    --cg-surface: #ffffff;
    --cg-background: #f5f7fa;
    --cg-text: #111827;
    --cg-muted: #6b7280;
    --cg-primary: #2563eb;
    --cg-success: #15803d;
    --cg-warning: #92400e;
    --cg-warning-bg: #fffbeb;
    --cg-warning-border: #fde68a;
}

/* ==========================================
   Layout
========================================== */

.cg-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

.cg-page-header {
    margin-bottom: 24px;
}

.cg-page-header h1 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--cg-text);
}

.cg-page-header p {
    margin: 0;
    color: var(--cg-muted);
}

/* ==========================================
   Notice Banner
========================================== */

.cg-notice {
    background: var(--cg-warning-bg);
    border: 1px solid var(--cg-warning-border);
    color: var(--cg-warning);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* ==========================================
   Cards
========================================== */

.cg-card {
    background: var(--cg-surface);
    border: 1px solid var(--cg-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.cg-card h2 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    color: var(--cg-text);
}

/* ==========================================
   Search Panel
========================================== */

.cg-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.cg-field-group {
    display: flex;
    flex-direction: column;
}

.cg-field-group label {
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: var(--cg-muted);
}

.cg-field-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cg-border);
    border-radius: 8px;
    background: #ffffff;
}

/* ==========================================
   Information Grids
========================================== */

.cg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.cg-field {
    border: 1px solid var(--cg-border);
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}

.cg-label {
    font-size: 0.8rem;
    color: var(--cg-muted);
    margin-bottom: 6px;
}

.cg-value {
    font-weight: 600;
    color: var(--cg-text);
}

/* ==========================================
   Preview Area
========================================== */

.cg-preview {
    min-height: 500px;
    border: 2px dashed var(--cg-border);
    border-radius: 12px;
    background: #fafafa;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
    padding: 32px;
    color: var(--cg-muted);
}

.cg-preview h3 {
    margin-bottom: 12px;
    color: var(--cg-text);
}

/* ==========================================
   Actions
========================================== */

.cg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cg-btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--cg-border);
    background: #ffffff;
    cursor: pointer;
}

.cg-btn:hover {
    background: #f9fafb;
}

.cg-btn-primary {
    background: var(--cg-primary);
    border-color: var(--cg-primary);
    color: #ffffff;
}

.cg-btn-primary:hover {
    opacity: 0.95;
}

.cg-btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================
   Responsive
========================================== */

@media (max-width: 768px) {

    .cg-container {
        padding: 16px;
    }

    .cg-card {
        padding: 16px;
    }

    .cg-page-header h1 {
        font-size: 1.6rem;
    }

    .cg-actions {
        flex-direction: column;
    }

    .cg-btn {
        width: 100%;
    }
}

.certificate-template {

    /*
    ==========================================
    Certificate Canvas Standard v1.0
    STATUS: LOCKED

    Inner Frame Test
    STATUS: EXPERIMENTAL
    NOT YET LOCKED
    ==========================================
    */

    width: 1100px;
    height: 778px;

    margin: 0 auto;
    padding: 40px;

    background: #ffffff;
    text-align: center;

    box-sizing: border-box;

    position: relative;
}

.certificate-template::before {

    content: "";

    position: absolute;

    top: 16px;
    right: 16px;
    bottom: 16px;
    left: 16px;

    border: 2px solid #d1d5db;

    pointer-events: none;

    box-sizing: border-box;
}

.certificate-header {
    margin-bottom: 32px;
}

.certificate-emblem {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto 16px auto;
}

.certificate-header h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
}

.certificate-header h2 {
    margin-top: 12px;
    font-size: 1.6rem;
    font-weight: 600;
    color: #111827;
}

.certificate-body {
    margin-top: 32px;
}

.recognition-intro,
.recognition-text,
.program-label {
    color: #6b7280;
}

#certLearnerName {
    font-size: 2rem;
    margin: 16px 0;
    color: #111827;
}

#certCredentialType {
    font-size: 1.8rem;
    margin: 16px 0;
    color: #111827;
}

#certProgramCode {
    margin-top: 8px;
    font-size: 1.2rem;
    color: #111827;
}

.certificate-footer {
    margin-top: 40px;
}

.certificate-metadata p,
.issuer-line {
    margin: 8px 0;
}