/**
 * Certificate Generator Frontend Styles
 *
 * @package CertGen
 */

/* ===== Main Container ===== */
.cert-gen-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.cert-gen-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

/* ===== Step Indicator ===== */
.cert-gen-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    padding: 0;
}

.cert-gen-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.cert-gen-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.cert-gen-step .step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.cert-gen-step .step-label {
    display: block;
    font-size: 12px;
    color: #999;
    transition: all 0.3s ease;
}

.cert-gen-step.active .step-number {
    background: #2271b1;
    color: white;
    box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.1);
}

.cert-gen-step.active .step-label {
    color: #2271b1;
    font-weight: 600;
}

.cert-gen-step.completed .step-number {
    background: #00a32a;
    color: white;
}

.cert-gen-step.completed .step-label {
    color: #00a32a;
}

/* ===== Messages ===== */
.cert-gen-messages {
    margin-bottom: 20px;
}

.cert-gen-message {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cert-gen-message-error {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.cert-gen-message-success {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    color: #166534;
}

.cert-gen-message-info {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    color: #1e40af;
}

.close-message {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.close-message:hover {
    opacity: 1;
}

/* ===== Form Sections ===== */
.cert-gen-form-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cert-gen-form-section h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 22px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

/* ===== Form Fields ===== */
.cert-gen-field {
    margin-bottom: 20px;
}

.cert-gen-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

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

.cert-gen-field input[type="text"],
.cert-gen-field input[type="email"],
.cert-gen-field input[type="date"],
.cert-gen-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cert-gen-field input:focus,
.cert-gen-field select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.cert-gen-field input.error,
.cert-gen-field select.error {
    border-color: #dc2626;
}

/* ===== Template Preview ===== */
.template-preview {
    margin-top: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.template-info h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2271b1;
}

.template-info p {
    margin: 5px 0;
    color: #666;
}

/* ===== Image Upload ===== */
.cert-gen-image-field {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.cert-gen-image-field label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #555;
}

.image-upload-box {
    position: relative;
    min-height: 150px;
}

.image-upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-placeholder {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    border-color: #2271b1;
    background: #f0f9ff;
}

.upload-placeholder svg {
    margin-bottom: 10px;
    opacity: 0.5;
}

.upload-placeholder p {
    margin: 10px 0 5px;
    color: #666;
    font-weight: 500;
}

.upload-placeholder small {
    color: #999;
    font-size: 12px;
}

.image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    border: 2px solid #00a32a;
    max-width: 300px;
    margin: 0 auto;
}

.image-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    padding:0 !important;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 3;
}

.remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.upload-progress {
    margin-top: 10px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #2271b1;
    transition: width 0.3s ease;
}

/* ===== Preview Section ===== */
.cert-gen-preview-container {
    margin-bottom: 30px;
}

.preview-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#preview-image-container {
    text-align: center;
}

#preview-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.preview-watermark-notice {
    color: #666;
    font-size: 13px;
    font-style: italic;
    margin-top: 10px;
}

.data-summary {
    background: #f9fafb;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
}

.data-summary h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.data-list li:last-child {
    border-bottom: none;
}

.data-list strong {
    color: #555;
    margin-right: 10px;
}

/* ===== Payment Section ===== */
.cert-gen-payment-info {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.cert-gen-payment-info h4 {
    margin-top: 0;
    color: #92400e;
}

.payment-amount {
    font-size: 18px;
    margin: 10px 0;
}

.payment-amount strong {
    color: #2271b1;
    font-size: 24px;
}

.cert-gen-card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    margin-bottom: 15px;
}

.cert-gen-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 10px;
}

/* ===== Success Section ===== */
.cert-gen-success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.success-circle {
    stroke: #00a32a;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmark-circle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-check {
    stroke: #00a32a;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmark-check 0.3s 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes checkmark-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes checkmark-check {
    to { stroke-dashoffset: 0; }
}

.cert-gen-success-message h4 {
    color: #00a32a;
    font-size: 24px;
    margin: 0;
}

.cert-gen-download-actions {
    text-align: center;
    margin: 30px 0;
}

.cert-gen-new-certificate {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.processing-section {
    text-align: center;
    padding: 60px 20px;
}

#processing-message {
    color: #666;
    font-size: 16px;
    margin-top: 20px;
}

/* ===== Buttons ===== */
.cert-gen-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cert-gen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.cert-gen-btn-primary {
    background: #2271b1;
    color: white;
    margin-top:1rem
}
.cert-gen-btn-primary.disabled {
    background: #696969 !important;
    color: white;
}
.cert-gen-btn-primary:hover {
    background: #135e96;
}

.cert-gen-btn-secondary {
    background: #f0f0f1;
    color: #2c3338;
}

.cert-gen-btn-secondary:hover {
    background: #dcdcde;
}

.cert-gen-btn-success {
    background: #00a32a;
    color: white;
}

.cert-gen-btn-success:hover {
    background: #008a20;
}

.cert-gen-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Auto-pick buttons for select & place_of_birth fields */
.cert-gen-auto-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #2271b1;
    border-radius: 4px;
    background: #f0f6fc;
    color: #2271b1;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.cert-gen-auto-btn:hover {
    background: #2271b1;
    color: #fff;
}

/* Wrapper that puts the select + auto-pick button side by side */
.select-with-auto {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.select-with-auto select {
    flex: 1;
    min-width: 0;
}

/* Row that puts the text input + auto-pick button side by side */
.place-of-birth-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.place-of-birth-input-row input {
    flex: 1;
    min-width: 0;
}

.cert-gen-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.cert-gen-actions button {
    flex: 1;
}

.download-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .cert-gen-wrapper {
        padding: 20px 10px;
    }

    .cert-gen-form-section {
        padding: 20px 15px;
    }

    .cert-gen-steps {
        flex-wrap: wrap;
    }

    .cert-gen-step {
        flex: 0 0 50%;
        margin-bottom: 20px;
    }

    .cert-gen-step .step-label {
        font-size: 11px;
    }

    .cert-gen-actions {
        flex-direction: column;
    }

    .cert-gen-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .cert-gen-step {
        flex: 0 0 100%;
    }

    .cert-gen-steps::before {
        display: none;
    }

    .cert-gen-btn {
        width: 100%;
    }
}
.hidden{
    display: none;
}
.loader-wrapper {
    width: 100%;
    max-width:100% !important;
    height: 100%;
    max-height:100% !important;
    position: fixed;
    top: 0;
    left: 0;
    background: #1f1818a1;
    z-index: 99999;
}
.loader {
  --d:22px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  color: #25b09b;
  box-shadow:
    calc(1*var(--d))      calc(0*var(--d))     0 0,
    calc(0.707*var(--d))  calc(0.707*var(--d)) 0 1px,
    calc(0*var(--d))      calc(1*var(--d))     0 2px,
    calc(-0.707*var(--d)) calc(0.707*var(--d)) 0 3px,
    calc(-1*var(--d))     calc(0*var(--d))     0 4px,
    calc(-0.707*var(--d)) calc(-0.707*var(--d))0 5px,
    calc(0*var(--d))      calc(-1*var(--d))    0 6px;
  animation: l27 1s infinite steps(8);
  position: fixed;
    top: 45%;
    left: 50%;
}
@keyframes l27 {
  100% {transform: rotate(1turn)}
}