/* --- Certificate pages --- */
.cert-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
    background: linear-gradient(135deg, #f5f7f5 0%, #e8f0e8 100%);
}

/* --- Lookup page --- */
.cert-lookup {
    max-width: 500px;
    width: 100%;
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.cert-lookup h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.cert-lookup p {
    color: #666;
    margin-bottom: 25px;
}

.cert-lookup-form .form-input {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.cert-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.cert-logo {
    height: 70px;
    margin-bottom: 15px;
    border-radius: 50%;
    background: white;
    padding: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* --- Certificate view --- */
.cert-wrapper {
    max-width: 900px;
    width: 100%;
    background: white;
    border-radius: 24px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    position: relative;
}

.cert-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--accent-gold, #c9a84c), var(--primary-medium), var(--accent-gold, #c9a84c));
}

.cert-header {
    text-align: center;
    padding: 50px 30px 35px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-medium));
    color: white;
    position: relative;
}

.cert-header::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    border: 3px solid var(--accent-gold, #c9a84c);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231B5E20'%3E%3Cpath d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    z-index: 1;
}

.cert-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin: 10px 0 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cert-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 10px;
    opacity: 0.95;
}

.cert-dates {
    font-size: 0.95rem;
    opacity: 0.85;
}

.cert-expired-badge {
    display: inline-block;
    margin-top: 10px;
    background: #f44336;
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- Progress bar --- */
.cert-progress {
    padding: 30px 30px 10px;
    text-align: center;
}

.cert-progress-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.cert-progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.cert-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-medium), var(--accent-gold, #c9a84c));
    border-radius: 5px;
    transition: width 0.6s ease;
}

/* --- Fields grid --- */
.cert-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 30px 30px;
}

.cert-field {
    padding: 25px 15px;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cert-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.cert-field.completed::before {
    background: linear-gradient(90deg, #4caf50, #81c784);
}

.cert-field.waiting::before {
    background: linear-gradient(90deg, #bdbdbd, #e0e0e0);
}

.cert-field.expired::before {
    background: linear-gradient(90deg, #f44336, #e57373);
}

.cert-field:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* waiting (gray) */
.cert-field.waiting {
    background: #f5f5f5;
    border: 2px solid #bdbdbd;
}

/* completed (green) */
.cert-field.completed {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

/* expired unfilled (red) */
.cert-field.expired {
    background: #ffebee;
    border: 2px solid #f44336;
}

.cert-field-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waiting .cert-field-icon {
    background: #bdbdbd;
}

.completed .cert-field-icon {
    background: #4caf50;
}

.expired .cert-field-icon {
    background: #f44336;
}

.cert-field-icon svg {
    fill: white;
    width: 28px;
    height: 28px;
}

.cert-field-label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #333;
}

.cert-field-status {
    font-size: 0.85rem;
    color: #777;
}

.completed .cert-field-status {
    color: #2e7d32;
    font-weight: 500;
}

.expired .cert-field-status {
    color: #c62828;
    font-weight: 500;
}

/* --- Footer --- */
.cert-footer {
    text-align: center;
    padding: 25px 30px;
    border-top: 1px solid #e0e0e0;
    color: #888;
    font-size: 0.9rem;
    background: #fafafa;
}

.cert-footer p:first-child {
    font-weight: 600;
    color: #555;
}

.cert-uuid {
    font-family: monospace;
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 4px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .cert-page {
        padding: 80px 10px 20px;
    }

    .cert-fields-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 20px;
    }

    .cert-field {
        padding: 18px 10px;
    }

    .cert-field-icon {
        width: 48px;
        height: 48px;
    }

    .cert-field-icon svg {
        width: 22px;
        height: 22px;
    }

    .cert-header h1 {
        font-size: 1.5rem;
    }

    .cert-header h2 {
        font-size: 1.2rem;
    }

    .cert-lookup {
        padding: 30px 20px;
    }
}

.header-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'><path d='M0,0V26c60,20,120,35,180,31s120-29,180-33c60-4,120,15,180,30s120,20,180,10,120-40,180-50,120,0,180,20,120,50,120,50V0Z' opacity='.25' fill='%231b5e20'></path><path d='M0,0V10c30,30,60,55,120,70s120,10,180-10,120-60,180-60,120,30,180,60,120,30,180,10,120-60,180-70,120,10,180,30,120,20,120,20V0Z' opacity='.5' fill='%231b5e20'></path><path d='M0,0V5c150,50,300,60,450,30s300-70,450-10,300,60,450,20V0Z' fill='%231b5e20'></path></svg>") no-repeat center center;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 1;
}
