﻿@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap');

.ai-badge {
    background: rgba(250, 250, 250, 0.4);
    color: #4a4a4a;
    font-size: 11px;
    padding: 10px;
    text-align: center;
    width: 250px;
    margin: 30px auto;
}

.ai-badge2 {
    background: rgba(250, 250, 250, 0.6);
    color: #707070;
    font-size: 11px;
    padding: 15px;
    text-align: center;
    width: 65%;
    max-width: 400px;
    margin: 30px auto;
    border-radius: 4px;
}

.aiframe-app{
  position: relative;
  color:#4a4a4a;
  background: url("/App_Themes/img/bg.jpg") repeat;
  overflow: hidden;
  /*padding: 50px 0 80px;*/
}

/* Decorative layers */
.aiframe-app .aiframe-bg{
  position:absolute;
  left:0; right:0;
  min-height: 550px;
  z-index: 1;
  pointer-events: none;
  background-repeat: no-repeat;
}

.aiframe-app .aiframe-bg--top{
  top: -50px;
  background-image: url("/App_Themes/img/topdesktop1.png");
  background-position: top left;
}

.aiframe-app .aiframe-bg--bottom{
  bottom: 0;
  background-image: url("/App_Themes/img/bottomdesktop.png");
  background-position: bottom right;
  min-height: 550px;
}

@media (max-width: 600px){
  .aiframe-app .aiframe-bg--top{
    top: -30px;
    background-image: url("/App_Themes/img/topmobile.png");
  }
  .aiframe-app .aiframe-bg--bottom{
    background-image: url("/App_Themes/img/bottommobile.png");
    min-height: 360px;
  }
}

/* Inner wrapper (replaces designer .container) */
.aiframe-app .aiframe-container{
  position: relative;
  z-index: 10;
  display:flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 250px;
  gap: 40px;
}

/* Step wrappers */
.aiframe-app .aiframe-step{ display:block; }
.aiframe-app .aiframe-step[hidden]{ display:none !important; }
.aiframe-app .aiframe-step.is-active{ display:block; }

/* Columns */
.aiframe-app .left-preview{ flex: 1.2; text-align:center; }
.aiframe-app .right-form{ flex: 1; }

.aiframe-app .title-area h1{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 900;
  color:#4a4a4a;
}

.aiframe-app .title-area h1 img{
  width: 32px;
  height:auto;
  display:block;
}

.aiframe-app .title-area p{
  margin:0 auto;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.45;
  color:#6a6a6a;
}

/* ===== Card ===== */
.aiframe-app .white-card{
  background:#fff;
  padding: 20px 40px 60px;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
  position: relative;
}

.aiframe-app form{
  display:flex;
  flex-direction: column;
}

.aiframe-app .form-header{
  font-size: 1.25rem;
  font-weight: 700;
  color:#444;
  margin: 0 0 20px;
}

.aiframe-app .step-indicator{
  margin: 0 0 25px;
}
.aiframe-app .step-indicator span{
  background-color:#e2e2e2;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  color:#333;
}

/* ===== Inputs ===== */
.aiframe-app .input-wrap{ margin-bottom: 10px; position: relative; }

.aiframe-app label{
  display:block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
  color:#4a4a4a;
}

.ai-badge2 a{
    color:#BB0000;
}

.aiframe-app input:not([type="submit"]):not([type="button"]):not(input[type="date"]) {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

.aiframe-app #displayInput{
  width:100%;
  padding: 12px;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  font-size: 14px;
  outline:none;
}
.aiframe-app #displayInput:focus{ border-color:#bb0000; }

.aiframe-app .input-wrap small{
  display:block;
  margin-top: 5px;
  font-size: 12px;
  color:#999;
  font-weight: 400;
  transition: color .2s ease;
}
.aiframe-app .counter-error{ color:#bb0000 !important; }

.aiframe-app 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;
}
.aiframe-app input[type="date"]:focus{
  border: 1px solid #bb0000;
  outline:none;
  box-shadow: 0 0 5px rgba(187, 0, 0, 0.2);
}
.aiframe-app 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;
}

.aiframe-app input[type="text"]:focus,
.aiframe-app textarea:focus{
  border-color:#bb0000 !important;
  outline:none;
  box-shadow: 0 0 5px rgba(187, 0, 0, 0.2);
  transition: border-color .3s ease;
}

/* ===== Toggle ===== */
.aiframe-app .toggle-row{
  display:flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
}
.aiframe-app .switch{
  position:relative;
  display:inline-block;
  width: 65px;
  height: 32px;
}
.aiframe-app .switch input{ display:none; }

.aiframe-app .slider{
  position:absolute;
  cursor:pointer;
  top:0; left:0; right:0; bottom:0;
  background-color:#ccc;
  transition:.4s;
  border-radius: 34px;
}
.aiframe-app .slider:before{
  position:absolute;
  content:"";
  height:24px;
  width:24px;
  left:4px;
  bottom:4px;
  background-color:#fff;
  transition:.4s;
  border-radius: 50%;
}
.aiframe-app .switch input:checked + .slider{ background-color:#ba131a; }
.aiframe-app .switch input:checked + .slider:before{ transform: translateX(33px); }

.aiframe-app .slider .on,
.aiframe-app .slider .off{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color:#fff;
}
.aiframe-app .slider .on{ left:10px; display:none; }
.aiframe-app .slider .off{ right:10px; display:block; }
.aiframe-app .switch input:checked + .slider .on{ display:block; }
.aiframe-app .switch input:checked + .slider .off{ display:none; }

/* ===== Upload zone ===== */
.aiframe-app .drop-zone{
  border: 2px dashed #ddd;
  padding: 30px;
  text-align:center;
  color:#4a4a4a;
  border-radius: 4px;
  font-size: 13px;
  background: transparent;
}
.aiframe-app .drop-zone.drag-over,
.aiframe-app .drop-zone:active{
  border-color:#bb0000;
  background-color: rgba(187, 0, 0, 0.02);
}

.aiframe-app .info-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 4px;
  margin: 10px auto;
}
.aiframe-app .info-svg-wrapper{ display:flex; align-items:center; flex-shrink:0; }
.aiframe-app #info-icon{ width:16px; height:16px; display:block; }
.aiframe-app .info-line p{
  color:#939393;
  font-size: 11px;
  margin:0;
  line-height: 1.2;
}

/* ===== Terms checkbox ===== */
.aiframe-app .terms-wrap{ margin: 10px 0; }

@media (min-width: 601px) and (max-width: 1024px)
{
	.aiframe-app .terms-wrap {
		margin: 60px 0;
	}
}

.aiframe-app .custom-checkbox{
  display:flex;
  gap: 10px;
  cursor:pointer;
}
.aiframe-app .custom-checkbox input{ display:none; }

.aiframe-app .checkmark{
  width: 18px;
  height: 18px;
  border: 1px solid #ccc;
  border-radius: 4px;
  flex-shrink: 0;
}
.aiframe-app .terms-text{
  font-family: Lato, sans-serif;
  color:#4a4a4a;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 400;
}
.aiframe-app .terms-text a{ color:#bb0000; }

.aiframe-app .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: 16px 16px;
}

/* ===== Buttons ===== */

/*@media only screen and (min-width: 768px) {
    .aiframe-app .generate-btn {
        width: 105px;
        min-height: 44px;
        margin-left:auto;
        display:block;
    }
}*/

.aiframe-app .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;
}
.aiframe-app .generate-btn.disabled,
.aiframe-app .generate-btn:disabled{
  background-color:#a0a0a0;
  cursor:not-allowed;
  opacity:.9;
}

#wordCounter {
    display: block;
    text-align: right;
    font-size: 11px;
    margin-top: 5px;
    color: #d1d1d1;
}

/* ===== Preview illustration ===== */
.aiframe-app .frame-container{
  position: relative;
  display:inline-block;
  margin-top: 50px;
}
.aiframe-app .main-img{ width:250px; height:auto; display:block; margin:0 auto; }

.aiframe-app .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;
}
.aiframe-app .step-label strong{
  display:block;
  font-weight: 800;
  font-size: 15px;
}
.aiframe-app .arrow{
  position:absolute;
  width:45px;
  height:auto;
  opacity:.7;
}

.aiframe-app .step1{ top:15%; left:-150px; }
.aiframe-app .arrow1{ bottom:-40px; right:-10px; transform: rotate(10deg); }

.aiframe-app .step2{ top:45%; right:-150px; }
.aiframe-app .arrow2{ bottom:-45px; left:-20px; transform: rotate(-30deg) scaleX(-1); }

.aiframe-app .step3{ bottom:-120px; left:50%; transform: translateX(-50%); text-align:left; }
.aiframe-app .arrow3{ top:-40px; left:50%; transform: translateX(-50%) rotate(-90deg); }

/* ===== Modal ===== */
.aiframe-app .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;
}
.aiframe-app .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);
}
.aiframe-app .modal-title{
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 15px;
  color:#333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
.aiframe-app .terms-body{
  font-size: 14px;
  line-height: 1.6;
  color:#444;
}
.aiframe-app .terms-body ol{ padding-left: 20px; margin-top: 10px; }
.aiframe-app .terms-body li{ margin-bottom: 12px; }

.aiframe-app .modal-footer{
  margin-top: 20px;
  display:flex;
  justify-content:flex-start;
}
.aiframe-app .close-btn-red{
  background-color:#ba131a;
  color:#fff;
  border:none;
  padding: 10px 30px;
  border-radius: 8px;
  font-weight: 600;
  cursor:pointer;
}
.aiframe-app .close-btn-red:hover{ background-color:#8e0e14; }

@media (max-width: 600px){
  .aiframe-app .modal-content{
    margin: 10% auto;
    padding: 30px;
    width: 70%;
  }
}

/* =========================================================
   STEP 2 â€” headline + frame selection
========================================================= */
.aiframe-app .section-label{
  display:block;
  font-weight: 800;
  margin: 10px 0 8px;
  font-size: 14px;
  color:#4a4a4a;
}
.aiframe-app .selection-grid{
  display:flex;
  gap: 20px;
  align-items: stretch;
}

.aiframe-app .selection-box{
  background: #fff;
  padding: 40px 30px;
  border-radius: 15px;
  flex: 1;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  min-height: 350px;
}

.aiframe-app .inner-back{
  position: absolute;
  top: 15px;
  left: 20px;
  text-decoration: none;
  color: #444;
  font-size: 13px;
  font-weight: 600;
}
.aiframe-app .inner-back:hover{ color:#cc0000; }

.aiframe-app .option-item input,
.aiframe-app .frame-option input{
  display:none;
}

.aiframe-app .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;
}
.aiframe-app .option-item input:checked + .option-card{
  border: 1px solid #bb0000;
  background: #fff9f9;
  box-shadow: 0 0 5px rgba(187, 0, 0, 0.1);
}

/* frame grid */
.aiframe-app .frame-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: -10px;
}

/* Make each label clickable */
.aiframe-app .frame-option {
    display: block;
    cursor: pointer;
    margin-bottom: 15px;
}

/* Let the preview look like a card */
.aiframe-app .frame-option-item{
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

/* Active border when selected (weâ€™ll toggle this by JS later) */
.aiframe-app .frame-option-item.active{
  border: 1px solid #bb0000;
}

/* Step2 button position (desktop) */
.aiframe-app .selection-box .generate-btn{
  position: absolute;
  bottom: 12px;
  right: 30px;
}

/* Step2 responsive */
@media (max-width: 1024px){
  .aiframe-app .selection-grid{
    flex-direction: column;
    gap: 30px;
    width: 100%;
  }

  .aiframe-app .frame-grid{
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .aiframe-app .selection-box{
    width: 90%;
    margin: 0 auto;
  }

  .aiframe-app .selection-box .generate-btn{
    position: relative;
    width: 100%;
    bottom: 0;
    right: 0;
    margin-top: 30px;
  }
    /* Keeps the AI badge styled as a footer to the image */
    .ai-badge {
        font-size: 10px;
        padding: 10px;
        background: #fdfdfd;
    }
}

/* =========================================================
   COVER PREVIEW STYLES (from style-cover.css) â€” scoped
========================================================= */

/* Generic wrapper */
.aiframe-app .final-cover-wrapper{
  position: relative;
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
}

.aiframe-app .final-render{
  width: 100%;
  display:block;
  z-index: 1;
}

/* Award badge */
.aiframe-app .award-container{
  position: absolute;
  top: 3%;
  right: 3%;
  width: 28%;
  z-index: 10;
}
.aiframe-app .award-img{
  width: 100%;
  height: auto;
  display:block;
  aspect-ratio: 250 / 120;
  object-fit: contain;
}

/* -------------------------
   COVER 1
------------------------- */
.aiframe-app #cover1 .headline-overlay{
  position: absolute;
  top: 15%;
  left: 0;
  padding: 0 10%;
  text-align: center;
  z-index: 10;
}

.aiframe-app #cover1 #dynamic-headline{
  font-family: 'Roboto', sans-serif;
  font-size: clamp(0.7em, 4.5vw, 1.9em);
  font-weight: 900;
  color:#333;
  line-height: 1.1;
  margin:0;
}

.aiframe-app #cover1 .user-photo-container{
  position: absolute;
  top: 27%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  height: 46%;
  background:#eee;
  overflow:hidden;
  z-index: 5;
}
.aiframe-app #cover1 #main-photo-output{
  width:100%;
  height:100%;
  object-fit: cover;
}

.aiframe-app #cover1 .newspaper-footer{
  position: absolute;
  top: 73%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  height: 20px;
  background-color: #e9e8e3;
  display:flex;
  align-items:center;
  font-family: 'Roboto', sans-serif;
  overflow:hidden;
  z-index: 10;
}
.aiframe-app #cover1 .footer-tag{
  background-color:#000;
  min-width: 12%;
  color:#fff;
  font-size: 0.5em;
  font-weight: 700;
  padding: 0 4px;
  height:100%;
  display:flex;
  align-items:center;
  text-transform: uppercase;
}
.aiframe-app #cover1 .footer-credit{
  color:#333;
  font-size: 0.63em;
  padding-left: 5px;
  white-space: nowrap;
}
.aiframe-app #cover1 .footer-credit span{ font-weight: 700; }

@media (max-width: 600px){
  .aiframe-app #cover1 #dynamic-headline{
    font-size: clamp(0.7em, 5.5vw, 1.6em);
  }
  .aiframe-app #cover1 .newspaper-footer{ height: 18px; }
  .aiframe-app #cover1 .footer-tag{ font-size: 0.3em; padding: 0 5px; }
  .aiframe-app #cover1 .footer-credit{ font-size: 8px; }
}
@media (max-width: 1024px){
  .aiframe-app #cover1 #dynamic-headline{
    font-size: clamp(0.7em, 5.5vw, 2.4em);
  }
}

/* â€œsmall previewâ€ tuning (works even though your HTML repeats id="small-preview") */
.aiframe-app #small-preview .final-cover-wrapper{ border-radius: 0; width:100%; height:auto; cursor:pointer; }
.aiframe-app #small-preview #dynamic-headline{ font-size: clamp(0.7em, 0.8vw, 0.78em); }
.aiframe-app #small-preview .newspaper-footer{ min-height: 8px; max-height: 12px; top: 70%; }
.aiframe-app #small-preview .footer-tag{ font-size: 0.3em; padding: 0 4px; }
.aiframe-app #small-preview .footer-credit{ font-size: 0.4em; }

@media (max-width: 1024px){
  .aiframe-app #small-preview .final-cover-wrapper{ max-width: 850px; }
  .aiframe-app #small-preview #dynamic-headline{ font-size: clamp(1.7em, 4.5vw, 2.9em); }
  .aiframe-app #small-preview .newspaper-footer{ top: 72%; }
  .aiframe-app #small-preview .footer-credit{ font-size: clamp(0.6em, 4.5vw, 1.3em); }
  .aiframe-app #small-preview .footer-tag{ font-size: clamp(0.7em, 4.5vw, 1.0em); }
}

@media (max-width: 600px){
  .aiframe-app #small-preview .final-cover-wrapper{ max-width: 450px; }
  .aiframe-app #small-preview #dynamic-headline{ font-size: clamp(20px, 0.5vw, 36px); }
  .aiframe-app #small-preview .newspaper-footer{ top: 72%; }
  .aiframe-app #small-preview .footer-credit{ font-size: 0.7em; }
  .aiframe-app #small-preview .footer-tag{ font-size: 0.6em; }
}

/* -------------------------
   COVER 2
------------------------- */
.aiframe-app #cover2{
  position: relative;
  font-family: 'Roboto', sans-serif;
  background-color:#fff;
}

.aiframe-app #cover2 .award-container{
  position:absolute;
  top: 2%;
  right: 0%;
  z-index: 5;
}

.aiframe-app #cover2 .user-photo-container{
  position: absolute;
  width: 90%;
  top: 14%;
  left: 5%;
  height: 55%;
  overflow:hidden;
  display:block;
}
.aiframe-app #cover2 #main-photo-output{
  width:100%;
  height:100%;
  object-fit: cover;
}

.aiframe-app #cover2 .photo-credit-bar{
  position:absolute;
  bottom:0;
  right:0;
  width:100%;
  padding: 40px 15px 10px;
  display:flex;
  flex-direction: column;
  align-items:flex-end;
  background: linear-gradient(
    to top,
    rgba(255,255,255,0.90) 0%,
    rgba(255,255,255,0.5) 40%,
    rgba(255,255,255,0) 100%
  );
  z-index: 5;
}

.aiframe-app #cover2 .credit-and-date{
  font-family: 'Roboto', sans-serif;
  color:#000;
  font-size: 0.7em;
  text-align:right;
  line-height: 1.2;
  margin-bottom: 5px;
}

.aiframe-app #cover2 .credit-and-date strong{
  font-weight: 700;
  font-size: 14px;
  display:block;
}

.aiframe-app #cover2 .born-tag{
  background-color:#cc0000;
  color:#fff;
  font-family: 'Roboto', sans-serif;
  font-size: 10px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  padding: 3px 10px;
  white-space: nowrap;
}

.aiframe-app #cover2 .headline-overlay-bottom{
  position:absolute;
  top: 71%;
  left:0;
  width: 100%;
  text-align:center;
  padding: 0 10%;
  z-index: 10;
}

.aiframe-app #cover2 .dynamic-headline{
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  color:#333;
  font-size: clamp(24px, 4.5vw, 36px);
  line-height: 1.1;
  margin:0;
  text-transform:none;
}

/* small preview tuning cover 2 */
.aiframe-app #small-preview #cover2 .dynamic-headline{
  font-size: clamp(0.74em, 0.5vw, 1.78em);
}
.aiframe-app #small-preview #cover2 .photo-credit-bar{
  padding: 40px 5px 10px;
}
.aiframe-app #small-preview #cover2 .credit-and-date{
  font-size: 0.4em;
}
.aiframe-app #small-preview #cover2 .credit-and-date strong{
  font-size: 1.2em;
}
.aiframe-app #small-preview #cover2 .born-tag{
  font-size: 0.3em;
}

@media (max-width: 600px){
  .aiframe-app #small-preview #cover2 .dynamic-headline{ font-size: 1.7em; }
}
@media (max-width: 1024px){
  .aiframe-app #small-preview #cover2 .dynamic-headline{
    font-size: clamp(20px, 4.5vw, 46px);
  }
  .aiframe-app #small-preview #cover2 .credit-and-date{
    font-size: clamp(0.74em, 2.5vw, 1.4em);
  }
  .aiframe-app #small-preview #cover2 .photo-credit-bar{
    padding: 40px 15px 10px;
  }
}

/* -------------------------
   COVER 3
------------------------- */
.aiframe-app #cover3 .user-photo-container{
  position:absolute;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
  height: 50%;
  overflow:hidden;
  z-index: 5;
  display:block;
}
.aiframe-app #cover3 #main-photo-output{
  width:100%;
  height:100%;
  object-fit: cover;
}

.aiframe-app #cover3 .headline-overlay-top{
  position:absolute;
  top: 10%;
  width:100%;
  text-align:center;
  z-index: 10;
}
.aiframe-app #cover3 .dynamic-headline{
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: clamp(24px, 4.5vw, 34px);
  color:#000;
  line-height: 1.1;
  text-transform:none;
}

.aiframe-app #cover3 .photo-credit-bar{
  position:absolute;
  bottom:0;
  width:100%;
  height: 20%;
  padding: 10px 15px;
  display:flex;
  justify-content:flex-start;
  align-items:center;
  gap: 15px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  z-index: 10;
}

.aiframe-app #cover3 .credit-and-date{
  color:#fff;
  font-size: 10px;
  text-align:left;
  line-height: 1.2;
  z-index: 11;
}
.aiframe-app #cover3 .credit-and-date strong{
  font-size: 14px;
  display:block;
  text-transform: uppercase;
}

.aiframe-app #cover3 .stamp-container{
  position:absolute;
  width:100%;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  z-index: 12;
}
.aiframe-app #cover3 .born-stamp{
  position:absolute;
  padding-bottom: 20px;
  width: 60px;
  height:auto;
  display:block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  margin-left: -20%;
}

/* small preview cover 3 */
.aiframe-app #small-preview #cover3 .headline-overlay-top{ top: 11%; }
.aiframe-app #small-preview #cover3 .dynamic-headline{ font-size: 0.75em; }
.aiframe-app #small-preview #cover3 .photo-credit-bar{ padding: 10px 5px; }
.aiframe-app #small-preview #cover3 .credit-and-date{ font-size: 0.3em; }
.aiframe-app #small-preview #cover3 .credit-and-date strong{ font-size: 1.2em; }
.aiframe-app #small-preview #cover3 .born-stamp{ padding-bottom: 10%; width: 15%; }

@media (max-width: 600px){
  .aiframe-app #small-preview #cover3 .dynamic-headline{
    font-size: clamp(20px, 4.5vw, 46px);
  }
  .aiframe-app #small-preview #cover3 .credit-and-date{
    font-size: clamp(10px, 1.5vw, 24px);
    font-weight: 400;
  }
  .aiframe-app #small-preview #cover3 .photo-credit-bar{ padding: 10px 15px; }
  .aiframe-app #small-preview #cover3 .born-stamp{ padding-bottom: 7%; width: 15%; }
}
@media (max-width: 1024px){
  .aiframe-app #small-preview #cover3 .dynamic-headline{
    font-size: clamp(20px, 4.5vw, 46px);
  }
  .aiframe-app #small-preview #cover3 .credit-and-date{
    font-size: clamp(12px, 1.5vw, 24px);
    font-weight: 400;
  }
  .aiframe-app #small-preview #cover3 .credit-and-date strong{ font-size: 1.1em; }
  .aiframe-app #small-preview #cover3 .born-stamp{ padding-bottom: 5%; width: 15%; }
  .aiframe-app #small-preview #cover3 .photo-credit-bar{ padding: 10px 20px; }
}

/* =========================================================
   STEP 1 responsive stacking (kept behaviour)
========================================================= */
@media (max-width: 600px){
  .aiframe-app .aiframe-container{
    flex-direction: column;
    align-items:center;
    padding: 20px 15px 150px;
    margin-top: 20px;
  }
  .aiframe-app .left-preview,
  .aiframe-app .right-form{
    width:100%;
    flex:none;
  }
  .aiframe-app .frame-container{
    margin-top: 20px;
    margin-bottom: 40px;
  }
  .aiframe-app .main-img{
    width: 50%;
    margin: 0 auto;
  }
  .aiframe-app .step-label{
    position:absolute;
    min-width: 40px;
    width:auto;
    height:auto;
  }
  .aiframe-app .step1{ top: 15%; left: 0%; }
  .aiframe-app .step2{ top: 45%; right: 0%; }
  .aiframe-app .step3{
    bottom: -50%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 100px;
  }
  .aiframe-app .arrow1{ bottom:-35px; right: 15px; }
  .aiframe-app .arrow2{ bottom:-40px; left: 20px; }
  .aiframe-app .arrow3{ top:-35px; }

  .aiframe-app .white-card{
    padding: 25px 20px;
    margin-top: 50px;
  }
  .aiframe-app .generate-btn{
    width: 100%;
    position:static;
  }
    
    .aiframe-app{
        padding:0;
    }
}

@media (min-width: 601px) and (max-width: 1024px){
  .aiframe-app .aiframe-container{
    flex-direction: column;
    align-items:center;
    padding: 20px 15px 150px;
    margin-top: 20px;
  }
  .aiframe-app .left-preview,
  .aiframe-app .right-form{
    width:100%;
    flex:none;
  }
  .aiframe-app .frame-container{
    margin-top: 20px;
    margin-bottom: 40px;
  }
  .aiframe-app .main-img{
    width: 50%;
    margin: 0 auto;
  }
  .aiframe-app .step1{ top: 15%; left: 6%; }
  .aiframe-app .step2{ top: 60%; right: 3%; }
  .aiframe-app .step3{
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 100px;
  }
  .aiframe-app .arrow1{ bottom:-40px; right: 0px; }
  .aiframe-app .arrow2{ bottom:-45px; left: 0px; }
  .aiframe-app .arrow3{ top:-45px; }

  .aiframe-app .white-card{
    padding: 25px 20px;
    margin-top: 50px;
  }
  .aiframe-app .generate-btn{
    width: 100%;
  }
}


/* RESULT FRAME SWITCH */

.result-frame{
display:none;
position:relative;
}

.result-frame.active{
display:block;
}

.js-result-photo{
width:100%;
height:auto;
object-fit:cover;
}

.final-render{
width:100%;
display:block;
}

/* =========================================================
   AI FRAME PATCH FIXES (paste at very bottom)
   - Upload icon center
   - Step 3 layout + typography
   - Fix Cover 1 headline selector mismatch
========================================================= */

/* 1) Upload icon box: always centered */
.aiframe-app .drop-zone{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.aiframe-app .upload-icon-box{
  width: 46px;
  height: 46px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.aiframe-app #upload-preview-icon{
  width: 28px;
  height: 28px;
  display:block;
  margin: 0 auto;
}

/* when user uploads photo, your JS sets width/height 64px - keep it centered */
.aiframe-app #upload-preview-icon[style]{
  display:block;
  margin: 0 auto;
}

/* 2) Step 3 "final step" layout - stop haywire */
.aiframe-app .aiframe-step[data-step="3"] .aiframe-container.final-container{
  align-items: center;
  padding-bottom: 160px; /* less crazy than 250 */
}

.aiframe-app .aiframe-step[data-step="3"] .result-text-area{
  text-align:center;
}

.aiframe-app .aiframe-step[data-step="3"] .result-text-area .title-area h1{
  font-size: 36px;
  font-weight: 900;
  margin: 0 0 10px;
  font-family: Lato, sans-serif;
}

.aiframe-app .aiframe-step[data-step="3"] .result-text-area .title-area p{
  font-size: 14px;
  line-height: 1.45;
  margin: 0 auto 14px;
  color:#6a6a6a;
  font-family: Lato, sans-serif;
}

.aiframe-app .aiframe-step[data-step="3"] .action-buttons{
  display:flex;
  justify-content:center;
  gap: 10px;
  margin: 8px 0 12px;
}

.aiframe-app .aiframe-step[data-step="3"] .icon-btn{
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #919191;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.aiframe-app .aiframe-step[data-step="3"] .icon-btn img{
      width: 20px;
    filter: invert(1);
}

/* Right side: make result behave like preview card */
.aiframe-app .aiframe-step[data-step="3"] .result-image-area{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

/* IMPORTANT: result frame must have same wrapper rules as preview */
.aiframe-app .aiframe-step[data-step="3"] .result-frame{
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  border-radius: 4px;
  overflow:hidden;
}

/* keep active logic */
.aiframe-app .result-frame{ display:none; position:relative; }
.aiframe-app .result-frame.active{ display:block; }

/* 3) Fix headline sizing (your CSS targets #dynamic-headline but HTML uses classes) */
.aiframe-app #cover1 .dynamic-headline,
.aiframe-app #cover1 .js-headline,
.aiframe-app .result-frame[data-frame="cover1"] .js-result-headline{
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  color:#333;
  line-height: 1.1;
  margin:0;
  font-size: clamp(18px, 2.2vw, 34px);
}

/* Make Step2 cover1 headline also follow same rule */
.aiframe-app #cover1 .headline-overlay h2{
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  line-height: 1.1;
}

/* Result headline blocks should never inherit weird global h2 */
.aiframe-app .aiframe-step[data-step="3"] .js-result-headline{
  font-family: 'Roboto', sans-serif !important;
  font-weight: 900 !important;
  margin:0 !important;
}

/* Result name/date text style stable */
.aiframe-app .aiframe-step[data-step="3"] .newspaper-footer,
.aiframe-app .aiframe-step[data-step="3"] .photo-credit-bar{
  font-family: 'Roboto', sans-serif;
}

/* Mobile: keep Step3 tidy */
@media (max-width: 600px){
  .aiframe-app .aiframe-step[data-step="3"] .aiframe-container.final-container{
    flex-direction: column;
    padding-bottom: 120px;
  }
  .aiframe-app .aiframe-step[data-step="3"] .result-text-area .title-area h1{
    font-size: 28px;
  }
}

/* =========================================================
   STYLE-COVER "MISSING GLUE" â€” scoped + conflict-safe
   Paste at VERY BOTTOM of aiframe.css
========================================================= */

/* A) cover overlay helper (some templates rely on this) */
.aiframe-app .newspaper-content-overlay{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}

/* B) frame selection card shadow (your ori has this) */
.aiframe-app .frame-option-item{
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

/* C) Cover 1 wrapper in selection preview (ori sets 450px) */
.aiframe-app #cover1 .final-cover-wrapper{
  max-width: 450px;
  background: transparent;
  box-shadow: none;
}

/* D) IMPORTANT: Fix headline selector mismatch everywhere
   (ori uses #dynamic-headline but your HTML often uses .dynamic-headline / .js-headline / .js-result-headline) */
.aiframe-app #cover1 #dynamic-headline,
.aiframe-app #cover1 .dynamic-headline,
.aiframe-app #cover1 .js-headline,
.aiframe-app .result-frame[data-frame="cover1"] .js-result-headline{
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  color:#333;
  line-height: 1.1;
  margin: 0;
  font-size: clamp(0.7em, 0.8vw, 0.78em);
}

/* E) FIX: newspaper footer should be anchored at "top:73%" (NOT bottom:0)
   Your ori css has BOTH versions; the bottom:0 one causes haywire when wrapper height changes.
   So we enforce ONE rule (the good one) */
.aiframe-app #cover1 .newspaper-footer{
  position:absolute;
  top: 73%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  height: 20px;
  background-color: #e9e8e3;
  display:flex;
  align-items:center;
  font-family: 'Roboto', sans-serif;
  overflow:hidden;
  z-index: 10;
}

/* footer text sizing stable */
.aiframe-app #cover1 .footer-tag{
  background:#000;
  min-width:12%;
  color:#fff;
  font-size: 0.5em;
  font-weight:700;
  padding: 0 4px;
  height:100%;
  display:flex;
  align-items:center;
  text-transform:uppercase;
}
.aiframe-app #cover1 .footer-credit{
  color:#333;
  font-size: 0.63em;
  padding-left: 5px;
  white-space: nowrap;
}
.aiframe-app #cover1 .footer-credit span{ font-weight:700; }

/* F) small preview wrapper reset (ori) */
.aiframe-app #small-preview .final-cover-wrapper{
  border-radius: 0;
  width: 100%;
  height: auto;
  cursor: pointer;
}

/* small preview headline (ori) */
.aiframe-app #small-preview #dynamic-headline,
.aiframe-app #small-preview .dynamic-headline{
  font-size: clamp(0.7em, 0.8vw, 0.78em);
}

/* small preview footer positioning */
.aiframe-app #small-preview .newspaper-footer{
  min-height: 8px;
  max-height: 12px;
  top: 70%;
}
.aiframe-app #small-preview .footer-tag{ font-size: 0.3em; padding: 0 4px; }
.aiframe-app #small-preview .footer-credit{ font-size: 0.4em; }

/* G) Step 3: force result-frame to behave like final-cover-wrapper (stops overlay drifting) */
.aiframe-app .result-frame{
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
  position: relative; /* parent for absolute overlays */
}

/* =========================================================
   INTEGRATION 
   - multi-step in 1 page
   - active frame/result switching
========================================================= */

.aiframe-step[hidden] { display: none !important; }
.aiframe-step.is-active { display: block; }

/* result frame switching (Step 3) */
.result-frame { display: none; position: relative; }
.result-frame.active { display: block; }

/* frame card active border (Step 2 selection) */
.frame-option-item.active { border: 1px solid #bb0000; }

.result-image-area #resultMount{
  width: 100%;
}

.result-image-area #resultMount > .final-cover-wrapper{
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
}

.result-image-area .frame-option-item{
  box-shadow: none;
}

/* remove the temporary dynamic-result system */
.result-frame{
  display:none !important;
}

.ai-badge {
    background: #f8f9fa;
    color: #888;
    font-size: 11px;
    padding: 10px;
    text-align: center;
    margin-top: 40px;
    width: 300px;
    margin: 40px auto;
}

.recreate-link {
    color: #cc0000;
    text-decoration: underline;
    font-weight: 600;
    font-size: 16px;
    border: none;
}