.adpsp-app,
.adpsp-app * {
    box-sizing: border-box;
}

.adpsp-app {
    --accent: #d94f91;
    --accent-2: #7d63d8;
    --soft: #fff0f7;
    --soft-2: #f7f2ff;
    --ink: #162452;
    --muted: #64748b;

    max-width: 1500px;
    margin: 35px auto 70px;
    padding: 0 18px;
    font-family: "IBM Plex Sans Arabic", Arial, sans-serif;
    color: var(--ink);
}

.adpsp-hero {
    text-align: center;
    margin-bottom: 28px;
}

.adpsp-badge {
    display: inline-flex;
    padding: 7px 14px;
    border-radius: 999px;
    background: #fff5e9;
    color: #d96f00;
    font-weight: 700;
    margin-bottom: 10px;
}

.adpsp-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 800;
}

.adpsp-hero p {
    margin: 8px auto 0;
    color: var(--muted);
    font-size: 17px;
}

.adpsp-layout {
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr);
    gap: 24px;
    align-items: start;
}

.adpsp-panel {
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 24px;
    box-shadow: 0 14px 45px rgba(15, 23, 42, .07);
}

.adpsp-builder {
    padding: 24px;
}

.adpsp-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.adpsp-section-title > span {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: #fff4e7;
    color: #c86c00;
    font-weight: 800;
}

.adpsp-section-title h2 {
    margin: 0 0 2px;
    font-size: 19px;
}

.adpsp-section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.adpsp-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.adpsp-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.adpsp-field > span {
    font-size: 13px;
    font-weight: 700;
    color: #34425c;
}

.adpsp-field input,
.adpsp-field select,
.adpsp-field textarea {
    width: 100%;
    border: 1px solid #dbe2ec;
    background: #fff;
    border-radius: 13px;
    padding: 11px 12px;
    min-height: 46px;
    font: inherit;
    color: #17213a;
    outline: none;
}

.adpsp-field textarea {
    resize: vertical;
}

.adpsp-field input:focus,
.adpsp-field select:focus,
.adpsp-field textarea:focus {
    border-color: #fb991b;
    box-shadow: 0 0 0 3px rgba(251, 153, 27, .12);
}

.adpsp-wide {
    grid-column: 1 / -1;
}

.adpsp-custom-subject {
    display: none;
}

.adpsp-custom-subject.is-visible {
    display: flex;
}

.adpsp-divider {
    height: 1px;
    background: #edf0f5;
    margin: 28px 0;
}

.adpsp-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.adpsp-template {
    border: 1px solid #dce3ec;
    border-radius: 15px;
    padding: 13px 14px;
    background: #fff;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
}

.adpsp-template strong,
.adpsp-template small {
    display: block;
}

.adpsp-template strong {
    color: #17213a;
    margin-bottom: 2px;
}

.adpsp-template small {
    color: #7a879b;
}

.adpsp-template:hover,
.adpsp-template.is-active {
    border-color: #fc9012;
    background: #fff9f2;
    box-shadow: 0 0 0 2px rgba(252, 144, 18, .1);
}

.adpsp-preview-panel {
    padding: 20px;
    position: sticky;
    top: 20px;
}

.adpsp-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.adpsp-preview-head h2 {
    margin: 0;
    font-size: 20px;
}

.adpsp-preview-head p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.adpsp-print {
    border: 0;
    border-radius: 12px;
    background: #17213a;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    padding: 11px 16px;
    cursor: pointer;
}

.adpsp-preview {
    display: grid;
    gap: 20px;
}

.adpsp-page {
    --page-accent: var(--accent);
    --page-accent2: var(--accent-2);
    --page-soft: var(--soft);

    position: relative;
    overflow: hidden;

    aspect-ratio: 210 / 297;
    width: 100%;

    background:
        radial-gradient(circle at 8% 9%, var(--page-soft) 0 11%, transparent 11.5%),
        radial-gradient(circle at 93% 88%, var(--soft-2) 0 13%, transparent 13.5%),
        #fff;

    border: 1px solid #eceff5;
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(22, 36, 82, .10);

    padding: 7%;

    display: flex;
    flex-direction: column;

    color: #17245b;
}

.adpsp-preview[data-template="flowers"] {
    --accent: #db4d94;
    --accent-2: #8766dc;
    --soft: #fff0f7;
    --soft-2: #f3efff;
}

.adpsp-preview[data-template="space"] {
    --accent: #4256b5;
    --accent-2: #159bb8;
    --soft: #edf1ff;
    --soft-2: #eafcff;
}

.adpsp-preview[data-template="sport"] {
    --accent: #247a4e;
    --accent-2: #426e2d;
    --soft: #eef9ef;
    --soft-2: #f1f8e9;
}

.adpsp-preview[data-template="colorful"] {
    --accent: #ef6c42;
    --accent-2: #646bd5;
    --soft: #fff1e9;
    --soft-2: #eff7ff;
}

.adpsp-preview[data-template="academic"] {
    --accent: #345d8c;
    --accent-2: #64748b;
    --soft: #eff5fa;
    --soft-2: #f4f6f8;
}

.adpsp-decoration {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    opacity: .16;
}

.decor-one {
    width: 170px;
    height: 170px;
    background: var(--accent);
    top: -70px;
    right: -45px;
}

.decor-two {
    width: 120px;
    height: 120px;
    background: var(--accent-2);
    bottom: 7%;
    left: -45px;
}

.decor-three {
    width: 55px;
    height: 55px;
    border: 9px solid var(--accent);
    background: transparent;
    top: 25%;
    left: 9%;
}

.adpsp-cover {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.adpsp-subject-symbol,
.adpsp-large-symbol {
    width: 90px;
    height: 90px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: var(--soft);
    color: var(--accent);
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 18px;
}

.adpsp-small-title {
    margin: 0;
    color: #758097;
    font-weight: 700;
    font-size: 18px;
}

.adpsp-cover h2 {
    margin: 8px 0 0;
    color: var(--accent);
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 900;
}

.adpsp-cover-line {
    width: 85px;
    height: 5px;
    border-radius: 10px;
    background: var(--accent-2);
    margin: 18px 0 24px;
}

.adpsp-cover h3 {
    font-size: clamp(22px, 3vw, 34px);
    margin: 0 0 28px;
}

.adpsp-cover-data {
    width: 88%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.adpsp-cover-data > div {
    background: rgba(255,255,255,.85);
    border: 1px solid #e9e8f0;
    border-radius: 15px;
    padding: 12px;
}

.adpsp-cover-data span,
.adpsp-cover-data strong {
    display: block;
}

.adpsp-cover-data span {
    color: #8992a6;
    font-size: 12px;
    margin-bottom: 3px;
}

.adpsp-cover-data strong {
    font-size: 15px;
}

.adpsp-page-title {
    display: flex;
    justify-content: center;
    margin-bottom: 8%;
}

.adpsp-page-title span {
    display: inline-flex;
    padding: 12px 30px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800;
}

.adpsp-about-card,
.adpsp-info-card,
.adpsp-goal-card,
.adpsp-thanks-box {
    border: 1px solid #e7eaf0;
    border-radius: 20px;
    background: rgba(255,255,255,.9);
}

.adpsp-about-card {
    padding: 7%;
    text-align: center;
}

.adpsp-about-card h3 {
    color: var(--accent);
    font-size: clamp(22px, 3vw, 34px);
    margin: 0 0 12px;
}

.adpsp-about-card p {
    margin: 0;
    line-height: 1.9;
    font-size: clamp(14px, 2vw, 19px);
}

.adpsp-card-grid {
    margin-top: 4%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4%;
}

.adpsp-info-card {
    padding: 8%;
    text-align: center;
}

.adpsp-info-card h4,
.adpsp-goal-card h4 {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: clamp(18px, 2.5vw, 25px);
}

.adpsp-info-card p,
.adpsp-goal-card p {
    margin: 0;
    line-height: 1.8;
}

.adpsp-goal-card {
    margin-top: 4%;
    padding: 6%;
    text-align: center;
}

.adpsp-thanks-box {
    margin: auto 2%;
    padding: 10%;
    text-align: center;
    line-height: 2.1;
    font-size: clamp(16px, 2.2vw, 22px);
}

.adpsp-teacher-name {
    font-size: clamp(21px, 3vw, 31px);
    color: var(--accent);
    margin-top: 0;
}

.adpsp-thanks-subject {
    display: inline-flex;
    gap: 7px;
    margin-top: 6%;
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--soft);
}

.adpsp-subject-page {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.adpsp-subject-page > p {
    margin: 0 0 16px;
    color: #7b8497;
    font-size: clamp(18px, 2.5vw, 27px);
    font-weight: 700;
}

.adpsp-large-symbol {
    width: 130px;
    height: 130px;
    border-radius: 40px;
    font-size: 55px;
}

.adpsp-subject-page h2 {
    margin: 10px 0 28px;
    color: var(--accent);
    font-size: clamp(38px, 6vw, 67px);
    font-weight: 900;
}

.adpsp-name-pill {
    border: 1px solid #e2e5ec;
    background: #fff;
    padding: 12px 30px;
    border-radius: 999px;
    font-weight: 700;
}

@media (max-width: 1050px) {
    .adpsp-layout {
        grid-template-columns: 1fr;
    }

    .adpsp-preview-panel {
        position: static;
    }
}

@media (max-width: 620px) {
    .adpsp-fields,
    .adpsp-template-grid {
        grid-template-columns: 1fr;
    }

    .adpsp-wide {
        grid-column: auto;
    }

    .adpsp-preview-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .adpsp-builder,
    .adpsp-preview-panel {
        padding: 14px;
        border-radius: 18px;
    }
}

@media print {

    @page {
        size: A4 portrait;
        margin: 0;
    }

    body * {
        visibility: hidden !important;
    }

    .adpsp-preview,
    .adpsp-preview * {
        visibility: visible !important;
    }

    .adpsp-preview {
        position: absolute;
        inset: 0;
        display: block;
        width: 210mm;
        margin: 0;
        padding: 0;
    }

    .adpsp-page {
        width: 210mm;
        height: 297mm;
        min-height: 297mm;
        max-height: 297mm;
        aspect-ratio: auto;
        margin: 0;
        padding: 15mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        page-break-after: always;
        break-after: page;
    }

    .adpsp-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }
}
