﻿/* Layer 1: Base Grey Background */
body {
    margin: 0;
    padding: 0;
    font-family: Lato, sans-serif;
    background: url('/App_Themes/img/bg.jpg') repeat;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    color: #4a4a4a;
}


/* Layer 2: Decorative Images (Behind Text) */
.bg-decoration {
    position: absolute;
    width: 100%;
    min-height: 550px;
    z-index: 1; /* Sits on top of grey.jpg but below main text */
    pointer-events: none;
    background-repeat: no-repeat;
}

/* Desktop Backgrounds */
.bg-top {
    background-image: url('/App_Themes/img/topdesktop1.png');
    background-position: top left;
}

.bg-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background-image: url('/App_Themes/img/bottomdesktop.png');
    background-position: bottom right;
}

/* Mobile Background Overrides */
@media (max-width: 600px) {
    .bg-top {
        top: -10px;
        background-image: url('/App_Themes/img/topmobile.png');
    }

    .bg-bottom {
        background-image: url('/App_Themes/img/bottommobile.png');
    }
}

/* Layer 4: Content Layout */
.ai-container {
    position: relative;
    z-index: 10;
    display: flex;
    max-width: 1100px;
    margin: 50px auto 0 auto;
    padding: 20px 20px 320px 20px;
    gap: 40px;
}

.left-preview {
    flex: 1.2;
    text-align: center;
}

.right-form {
    flex: 1;
}
/* Container for Checkbox and Label */
.input-wrap .row {
    display: flex; /* Forces items into a single row */
    align-items: center; /* Aligns checkbox and text vertically */
    margin-top: 10px; /* Spacing from the date input above */
    gap: 8px; /* Modern way to add space between checkbox and label */
}

    /* Specific styling for the checkbox input */
    .input-wrap .row input[type="checkbox"] {
        width: 16px; /* Standard checkbox size */
        height: 16px;
        margin: 0; /* Removes default browser margins */
        cursor: pointer;
    }

    /* Styling for the checkbox label text */
    .input-wrap .row label {
        font-weight: 400; /* Regular weight for the question text */
        font-size: 14px;
        margin-bottom: 0; /* Overrides any global label margins */
        cursor: pointer;
        color: #4a4a4a;
    }

/* The Form Card */
.white-card {
    background: #fff;
    padding: 20px 40px 60px 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    position: relative;
}
/* Hides the default icon in Chrome/Safari/Edge */
input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    box-sizing: border-box;
}

.input-wrap {
    position: relative;
}

input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    padding: 10px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    width: 100%;
    background-image: url('/App_Themes/img/calendar.svg');
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    background-size: 20px;
    color: #939393;
    font-family: Lato, sans-serif;
    box-sizing: border-box;
}

input[type="date"]:focus {
    border: 1px solid #bb0000;
}

/* Update Upload Zone border on drag or click */
.drop-zone.drag-over,
.drop-zone:active {
    border-color: #bb0000;
    background-color: rgba(187, 0, 0, 0.02);
}

/* Ensure the character counter turns red if over limit */
.counter-error {
    color: #bb0000 !important;
}

input[type="date"]:focus,
input[type="date"]:valid {
    color: #939393;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.5);
    opacity: 0.6;
}

.input-wrap .date-input {
    background: #fff url('/App_Themes/calendar-icon.svg') no-repeat;
    background-position: calc(100% - 12px) center;
    background-size: 18px;
    padding-right: 40px;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
    border-color: #bb0000 !important;
    outline: none;
    box-shadow: 0 0 5px rgba(187, 0, 0, 0.2);
    transition: border-color 0.3s ease;
}

/* Clear the float if you had it on form or container previously */
form {
    display: flex;
    flex-direction: column;
}

.form-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 20px;
}

.step-indicator {
    margin-bottom: 25px;
}

.step-indicator span {
    background-color: #e2e2e2;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    color: #333;
}

/* Loading state when generating headlines (step 1 → step 2) */
.loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    text-align: center;
    padding: 0;
    color: #4a4a4a;
    font-size: 1rem;
}
.loading.full-width {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
}
.loading-spinner {
    display: block;
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border: 4px solid #e2e2e2;
    border-top-color: #c00;
    border-radius: 50%;
    animation: loading-spin 0.9s linear infinite;
}
.loading-spinner + div {
    margin: 0;
    font-weight: 500;
}
@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

/* Step 1 error alert: above "Let's create your frame cover." (flagged image, API error) */
.step1-error-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 2px 8px rgba(153, 27, 27, 0.06);
}
.step1-error-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    line-height: 1;
}
.step1-error-text {
    flex: 1;
    margin: 0;
}

/* Step 2/3 error alert: above headline & frame selection */
.step2-error-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 2px 8px rgba(153, 27, 27, 0.06);
}
.step2-error-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    line-height: 1;
}
.step2-error-text {
    flex: 1;
    margin: 0;
}

/* Step 3 error alert: above "Choose your frame" */
.step3-error-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 2px 8px rgba(153, 27, 27, 0.06);
}
.step3-error-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    line-height: 1;
}
.step3-error-text {
    flex: 1;
    margin: 0;
}

/* Instructions Positioning */
.frame-container {
    position: relative;
    display: inline-block;
    margin-top: 50px;
}

.main-img {
    width: 250px;
}

/* Step Label Formatting */
.step-label {
    position: absolute;
    background: #fff;
    padding: 12px 14px;
    border: 1px solid #eee;
    font-size: 13px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    line-height: 1.4;
    text-align: left;
    min-width: 100px;
    z-index: 20;
}

    .step-label strong {
        display: block; /* Description on 2nd line */
        font-weight: 800;
        font-size: 15px;
    }

/* Arrow (line.png) Styling & Positioning */
.arrow {
    position: absolute;
    width: 45px;
    height: auto;
    opacity: 0.7;
}

/* Label & Arrow Positions */
.step1 {
    top: 15%;
    left: -150px;
}

.arrow1 {
    bottom: -40px;
    right: -10px;
    transform: rotate(10deg);
}

.step2 {
    top: 45%;
    right: -150px;
}

.arrow2 {
    bottom: -45px;
    left: -20px;
    transform: rotate(-30deg) scaleX(-1);
}

.step3 {
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: left;
}

.arrow3 {
    top: -40px;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg);
}



/* Interactive Elements */
.input-wrap {
    margin-bottom: 10px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

input:not([type="submit"]):not([type="button"]):not(input[type="date"]) {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}
/* Container to keep tooltip relative to icon */
.info-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 5px;
}

.info-icon {
    color: #666;
    font-style: normal;
    display: inline-block;
    transition: color 0.2s;
}

    .info-icon:hover {
        color: #cc0000;
    }

/* Tooltip Design */
.tooltip {
    visibility: hidden;
    width: 180px;
    background-color: #ffffff;
    color: #4a4a4a;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%; /* Position above the icon */
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s;
}

    /* Tooltip Arrow */
    .tooltip::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: #ffffff transparent transparent transparent;
    }

    /* Visible State */
    .tooltip.show {
        visibility: visible;
        opacity: 1;
    }

.input-wrap small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999; /* Muted grey */
    font-weight: 400;
    transition: color 0.2s ease;
}

/* Specific styling for the input to look cleaner */
#displayInput {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

#displayInput:focus {
    border-color: #bb0000;
}

/* Step 1 upload: file input overlays drop zone (invisible) so click opens dialog; when file present, only "Change photo" opens it */
.drop-zone .step1-file-input {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
}
.drop-zone.drop-zone-has-file .step1-file-input {
    pointer-events: none !important;
}

/* Step 1 upload preview: vertical stack (image, then filename, then change link). Hidden when no image; JS sets display:flex when uploaded. */
.step1-upload-preview {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.step1-upload-thumb {
    max-width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.step1-upload-done-text {
    font-size: 14px;
    color: #555;
}

/* Change photo as text link below image */
.step1-upload-change {
    background: none;
    border: none;
    color: #cc0000;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.step1-upload-change:hover {
    color: #990000;
}

.drop-zone {
    position: relative;
    border: 2px dashed #ddd;
    padding: 30px;
    text-align: center;
    color: #4a4a4a;
    border-radius: 4px;
    font-size: 13px;
}

.next-btn {
    background: #cc0000;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-weight: bold;
    float: right;
    cursor: pointer;
}

/* --- Toggle Switch Styling --- */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 65px;
    height: 32px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ba131a;
}

input:checked + .slider:before {
    transform: translateX(33px);
}

.slider .on,
.slider .off {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.slider .on {
    left: 10px;
    display: none;
}

.slider .off {
    right: 10px;
    display: block;
}

input:checked + .slider .on {
    display: block;
}

input:checked + .slider .off {
    display: none;
}

/* --- Custom Checkbox --- */
.terms-wrap {
    margin: 20px 0;
}

.custom-checkbox {
    display: flex;
    gap: 10px;
    cursor: pointer;
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
}

.terms-body {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.terms-body ol {
    padding-left: 20px;
    margin-top: 10px;
}

.terms-body li {
    margin-bottom: 12px;
}

.terms-text {
    font-family: Lato, sans-serif;
    color: #4a4a4a;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 400;
}

.custom-checkbox input:checked + .checkmark,
.custom-checkbox input:checked ~ .checkmark {
    background-color: #ba131a;
    border-color: #ba131a;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.info-line {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0px auto 10px auto;
    justify-content: center;
}

.info-svg-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#info-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.info-line p {
    color: #939393;
    font-size: 11px;
    margin: 0;
    line-height: 1.2;
    font-family: inherit;
}

.info-line .info2 {
    margin: 0;
    font-size: 11px;
    color: #939393;
}

/* --- Modal Styling --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 30px;
    max-width: 550px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
}

.close-btn-red {
    background-color: #ba131a;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.close-btn-red:hover {
    background-color: #8e0e14;
}

.terms-text a {
    color: #bb0000;
}

@media (max-width: 600px) {
    .modal-content {
        background: #fff;
        margin: 10% auto;
        padding: 30px;
        width: 70%;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
}

/* Step 1 upload empty state & icon box */
.step1-upload-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon-box {
    width: 24px;
    height: 24px;
}

.upload-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Next button disabled state (Step 1) - CSS-only so OnClientClick still runs when enabled */
/*.generate-btn.disabled {
    background-color: #a0a0a0;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.8;
    pointer-events: none;
}*/

/* Character/Word Counter */
#wordCounter {
    display: block;
    text-align: right;
    font-size: 11px;
    margin-top: 5px;
    color: #d1d1d1;
}

/* MOBILE Grid Switch */
@media (max-width: 600px) {
    .ai-container {
        flex-direction: column;
        align-items: center;
    }

    .step-label {
        position: static;
        margin: 10px auto;
        display: block;
        width: fit-content;
        transform: none;
    }
}
/* Optimized Mobile View (below 900px) */
@media (max-width: 600px) {
    /* 1. Stack columns vertically */
    .ai-container {
        flex-direction: column;
        align-items: center;
        padding: 20px 15px 150px 15px; /* Adjust bottom space for the tear image */
        margin-top: 40px;
    }

    .left-preview, .right-form {
        width: 100%;
        flex: none;
    }

    /* 2. Center the Frame Preview */
    .frame-container {
        margin-top: 20px;
        margin-bottom: 40px;
    }

    .main-img {
        width: 50%; /* Slightly larger for better mobile visibility */
        margin: 0 auto;
    }

    /* 3. Stack Labels Vertically below the frame */
    .step-label {
        position: absolute;
        background: #fff;
        padding: 12px 14px;
        border: 1px solid #eee;
        font-size: 13px;
        border-radius: 6px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
        line-height: 1.4;
        text-align: left;
        min-width: 40px;
        /* Allow height to adjust based on text wrap at smaller widths */
        height: auto;
        width: auto;
        z-index: 20;
    }

    /* 4. Positioning and Arrows Adjustments for smaller boxes */
    .step1 {
        top: 15%;
        left: 0%;
    }

    .step2 {
        top: 45%;
        right: 0%;
    }
    /* Maintain centering for the bottom step even if it resizes */
    .step3 {
        bottom: -50%;
        left: 50%;
        transform: translateX(-50%);
        min-width: 100px; /* Keep step 3 slightly wider for the longer text */
    }

    /* Adjust arrow positions slightly to stay attached to smaller boxes */
    .arrow1 {
        bottom: -35px;
        right: 15px;
    }

    .arrow2 {
        bottom: -40px;
        left: 20px;
    }

    .arrow3 {
        top: -35px;
    }

    /* 5. Adjust the Form Card */
    .white-card {
        padding: 25px 20px;
        margin-top: 50px;
    }

    /* 6. Ensure the Next button stays centered or full width */
    .next-btn {
        position: relative;
        bottom: 0;
        right: 0;
        width: 100%;
        margin-top: 20px;
        float: none;
    }

    /* 7. Adjust decorative backgrounds for mobile */
    .bg-top, .bg-bottom {
        background-size: contain;
    }

    .bg-bottom {
        height: 150px; /* Shorter tear for mobile screens */
    }
}

/* TABLET Grid Switch */
@media (min-width: 601px) and (max-width: 1024px) {
    .ai-container {
        flex-direction: column;
        align-items: center;
    }

    .step-label {
        position: static;
        margin: 10px auto;
        display: block;
        width: fit-content;
        transform: none;
    }
}
/* Optimized Mobile View (below 900px) */
@media (min-width: 601px) and (max-width: 1024px) {
    /* 1. Stack columns vertically */
    .ai-container {
        flex-direction: column;
        align-items: center;
        padding: 20px 15px 150px 15px;
        margin-top: 50px;
    }

    .bg-top{
        top: -30px;
    }
    .left-preview, .right-form {
        width: 100%;
        flex: none;
    }

    /* 2. Center the Frame Preview */
    .frame-container {
        margin-top: 20px;
        margin-bottom: 40px;
    }

    .main-img {
        width: 50%; /* Slightly larger for better mobile visibility */
        margin: 0 auto;
    }

    /* 3. Stack Labels Vertically below the frame */
    .step-label {
        position: absolute;
        background: #fff;
        padding: 12px 14px;
        border: 1px solid #eee;
        font-size: 14px;
        border-radius: 6px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
        line-height: 1.4;
        text-align: left;
        min-width: 40px;
        /* Allow height to adjust based on text wrap at smaller widths */
        height: auto;
        width: auto;
        z-index: 20;
    }

    /* 4. Positioning and Arrows Adjustments for smaller boxes */
    .step1 {
        top: 15%;
        left:6%;
    }

    .step2 {
        top: 60%;
        right: 3%;
    }
    /* Maintain centering for the bottom step even if it resizes */
    .step3 {
        bottom: -20%;
        left: 50%;
        transform: translateX(-50%);
        min-width: 100px; /* Keep step 3 slightly wider for the longer text */
    }

    /* Adjust arrow positions slightly to stay attached to smaller boxes */
    .arrow1 {
        bottom: -40px;
        right: 0px;
    }

    .arrow2 {
        bottom: -45px;
        left: 0px;
    }

    .arrow3 {
        top: -45px;
    }

    /* 5. Adjust the Form Card */
    .white-card {
        padding: 25px 20px;
        margin-top: 50px;
    }

    /* 6. Ensure the Next button stays centered or full width */
    .next-btn {
        position: relative;
        bottom: 0;
        right: 0;
        width: 100%;
        margin-top: 20px;
        float: none;
    }

    /* 7. Adjust decorative backgrounds for mobile */
    .bg-top, .bg-bottom {
        background-size: contain;
    }

    .bg-bottom {
        height: 150px; /* Shorter tear for mobile screens */
    }
}
/* STEP 2 */
/* Container for the overall layout */
/* Layout & Box Styling */
.selection-grid {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.selection-box {
    background: #fff;
    padding: 40px 30px 20px 30px;
    border-radius: 15px;
    flex: 1;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    height: auto;
}

/* Step 3 box: allow height to grow when error alert is shown so frame-grid and button don't overlap */
.selection-box-step3 {
    height: auto;
    min-height: 350px;
}

/* On desktop (1025px+), button is absolute so reserve enough bottom padding so it never overlaps the frame-grid */
@media (min-width: 1025px) {
    .selection-box-step3 {
        padding-bottom: 72px; /* 20px (bottom offset) + ~44px (button height) + small gap */
    }
}

/* Back Link inside the Box */
.inner-back {
    position: absolute;
    top: 15px;
    left: 20px;
    text-decoration: none;
    color: #444;
    font-size: 13px;
    font-weight: 600;
}

    .inner-back:hover {
        color: #cc0000;
    }

/* Remove default Checkbox/Radio button UI */
.option-item input,
.frame-option input {
    display: none;
}

/* Headline Selection Style */
.option-card {
    display: block;
    padding: 18px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-top: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    color: #4a4a4a;
}

.option-item input:checked + .option-card {
    border: 1px solid #bb0000;
    background: #fff9f9;
    outline: none;
    box-shadow: 0 0 5px rgba(187, 0, 0, 0.1);
    transition: border-color 0.3s ease;
}

/* Frame Selection Style */
.frame-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.frame-wrapper {
    border: 1px solid transparent;
    border-radius: 0px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    margin: 10px auto;
}

.frame-option input:checked + .frame-wrapper {
    border-color: #bb0000;
}

.frame-wrapper img {
    width: 100%;
    display: block;
    margin: 0 auto;
    border: 1px solid #d6d6d6;
    border-radius: 0px;
}

/* Floating Generate Button */
/*#pnlStep1 .generate-btn {
    background: #bb0000;
    color: white;
    border: none;
    padding: 12px 35px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0px;
} */

/*.generate-btn-wrapper{    
    width: 100%;
    display: flex;
    justify-content: end;
}*/
.generate-btn {
    /*position: absolute;
    bottom: 20px;
    right: 30px;*/
    /*background: #bb0000;
    color: white;
    border: none;
    padding: 12px 35px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;*/
}
/* --- TABLET VIEW (600px to 1024px) --- */
@media (min-width: 601px) and (max-width: 1024px) {
    /* Maintain 3 frames per row for tablet */
    .frame-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    /* Ensure the boxes can still sit side-by-side or stack based on width */
    .selection-grid {
        flex-direction: row;
        gap: 20px;
    }

    /* Adjust button to fit tablet width */
    .generate-btn {
        padding: 12px 25px;
        font-size: 14px;
        width: 100%;
    }
}

/* --- MOBILE VIEW (600px and below) --- */
@media (max-width: 600px) {
    /* Stack the two main white boxes vertically */
    .selection-grid {
        flex-direction: column;
        gap: 30px;
    }

    /* Maintain 1 frame per row as requested */
    .frame-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Reset the box for mobile */
    .selection-box {
        width: 90%;
        padding: 40px 20px;
    }

    /* Full-width button for mobile ergonomics */
    .generate-btn {
        position: relative;
        width: 100%;
        bottom: 0;
        right: 0;
        margin-top: 30px;
    }
}

@media (max-width: 1024px) {
    /* Stack the two main white boxes vertically */
    .selection-grid {
        display: flex;
        flex-direction: column; /* Stacks Step 3 under Step 2 */
        gap: 30px;
        width: 100%;
    }

    /* Maintain 1 frame per row as requested */
    .frame-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Reset the box for mobile */
    .selection-box {
        width: 90%;
        margin: 0 auto;
    }

    .generate-btn {
        position: relative;
        bottom: 0;
        left: 0;
        margin-top: 30px;
    }
}

/* --- PAGE3 --- */
/* --- Final Results Page Styles --- */

.final-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

/* Step 4: hide cover until headlines are fitted, then fade in (avoids flash of large headline) */
.final-container .final-cover-box {
    opacity: 0;
}
.final-container .final-cover-box.cover-visible {
    opacity: 1;
    transition: opacity 0.25s ease;
}

#pnlLoading .loading-text {
    margin-top: -55px;
    font-size: 15px;
    font-size: 14px;
    line-height: 1.5;    
}

#pnlLoading .loading-text .loading-ellipsis::after {
    content: '';
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: loading-ellipsis 1.1s steps(4, end) infinite;
}

@keyframes loading-ellipsis {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}
 
#step1SparkleLoader .sparkle.lg { width: 50px; height: 50px; top: 48%; left: 48%; animation-delay: 0s; }
#step1SparkleLoader .sparkle.md { width:  35px; height:  35px; top: 39%; left: 39%; animation-delay: -.2s; }
#step1SparkleLoader .sparkle.sm { width:  25px; height:  25px; top: 33%; left: 45%; animation-delay: -.5s; }

/* Step 4: wrapper so sparkle loader can overlay the cover */
.step4-cover-wrap {
    position: relative;
    display: inline-block;
}

/* Step 4 overlay: use sparkle loader from style-cover.css; make it fill the cover and add fade-out */
.step4-cover-wrap .sparkle-loader {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.sparkle-loader.step4-loader-done {
    opacity: 0;
    pointer-events: none;
}
.sparkle-loader {
    position: relative;
    width: 220px;
    height: 220px;
    --star-color: #bb0000;
    opacity: 0.6;
  }
  .sparkle path {
    fill: var(--star-color);
  }
  .sparkle-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);*/
    animation: sp-glow 1.2s ease-in-out infinite;
  }
  
  .sparkle {
    position: absolute;
    transform-origin: center;
    animation: sp-breathe 1.2s cubic-bezier(.45,.05,.55,.95) infinite;
  }
  
  /*.sparkle.lg { width: 70px; height: 80px; top: 48%; left: 48%; animation-delay: 0s; }
  .sparkle.md { width:  35px; height:  35px; top: 45%; left: 41%; animation-delay: -.2s; }
  .sparkle.sm { width:  25px; height:  25px; top: 41%; left: 45%; animation-delay: -.5s; }*/

  .sparkle.lg { width: 50px; height: 50px; top: 48%; left: 48%; animation-delay: 0s; }
  .sparkle.md { width:  35px; height:  35px; top: 45%; left: 43%; animation-delay: -.2s; }
  .sparkle.sm { width:  25px; height:  25px; top: 43%; left: 46%; animation-delay: -.5s; }

  
  /* offset from center */
  .sparkle.lg { translate: -50% -50%; }
  .sparkle.md { translate: -50% -50%; }
  .sparkle.sm { translate: -50% -50%; }
  
  @keyframes sp-breathe {
    0%, 100% { scale: 0.82; opacity: 0.7; }
    50%       { scale: 1.00; opacity: 1;   }
  }
  
  @keyframes sp-glow {
    0%, 100% { scale: 0.85; opacity: 0.5; }
    50%       { scale: 1.05; opacity: 1;   }
  }
/*============== End Sparkle Loader ==========*/
.result-text-area {
    text-align: center;
}

    .result-text-area h1 {
        font-size: 2.5rem;
        color: #4a4a4a;
        margin-bottom: 10px;
    }

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #919191; /* Dark grey circles as per mockup */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

    .icon-btn img {
        width: 20px;
        filter: invert(1); /* Makes icons white */
    }

    .icon-btn:hover {
        background: #cc0000;
    }

    .icon-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.recreate-link {
    color: #cc0000;
    text-decoration: underline;
    font-weight: 600;
    font-size: 16px;
}


.ai-badge {
    background: #f8f9fa;
    color: #888;
    font-size: 11px;
    padding: 10px;
    text-align: center;
    margin-top: 40px;
    width: 300px;
    margin: 40px auto;
}

/* Share modal: same overlay look as .modal (step 1 terms), different class to avoid conflict */
.share-modal-overlay {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.share-modal-overlay.show {
    display: flex;
}

/* Inner box reuses .modal-content; share-specific content below */
.share-modal.modal-content {
    margin: 10% auto;
}

.share-modal .modal-title,
.share-modal h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.share-modal-loading {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px 0;
}

.share-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.share-modal-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.2s, transform 0.2s;
}
.share-modal-btn:hover {
    color: #fff;
    transform: translateY(-1px);
}
.share-modal-btn.twitter { background-color: #1da1f2; }
.share-modal-btn.twitter:hover { background-color: #0d8bd9; }
.share-modal-btn.facebook { background-color: #1877f2; }
.share-modal-btn.facebook:hover { background-color: #0d65d9; }
.share-modal-btn.linkedin { background-color: #0a66c2; }
.share-modal-btn.linkedin:hover { background-color: #004182; }
.share-modal-btn.whatsapp { background-color: #25d366; }
.share-modal-btn.whatsapp:hover { background-color: #1da851; }

.share-modal-close {
    background-color: #ba131a;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    display: block;
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}
.share-modal-close:hover {
    background-color: #8e0e14;
}

@media (max-width: 600px) {
    .share-modal.modal-content {
        width: 90%;
        margin: 10% auto;
    }
    .share-modal-actions {
        flex-direction: column;
    }
    .share-modal-btn {
        width: 100%;
        text-align: center;
    }
}

.ico-share {
    /* This filter converts the image to pure white */
    filter: brightness(0) invert(1);
    height: auto;
    display: block;
}


/* --- MOBILE VIEW (Up to 900px) --- */
@media (max-width: 1024px) {
    .final-container {
        display: flex;
        /* Flips the order: Image (Top), Text (Bottom) */
        flex-direction: column;
        align-items: center;
        gap: 30px;
        padding-top: 20px;
    }

    /* Centers the text and action buttons */
    .result-text-area {
        width: 100%;
        text-align: center;
        margin-top: 30px;
    }

    .action-buttons {
        justify-content: center;
        margin-top: 20px;
    }

    /* Ensures the frame container is prominent at the top */
    .result-image-area {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .final-cover-wrapper {
        width: 90%; /* Responsive width for mobile */
        max-width: 350px;
    }

    /* Keeps the AI badge styled as a footer to the image */
    .ai-badge {
        font-size: 10px;
        padding: 10px;
        background: #fdfdfd;
    }
}

@media (min-width: 1025px) {
    .ai-container {
        width: 1100px;
    }
}