:root {
    --primary-gradient: linear-gradient(180deg, #667eea 0%, #0066ff 100%);
    --accent-gradient: linear-gradient(180deg, #4fe0ff, #5577ff);
    --text-dark: #1b0b2a;
    --card-bg: rgba(255,255,255,0.98);  
    --radius-xl: 14px;
    font-family: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at 20% 20%, #49c6ff 0%, transparent 35%),
        radial-gradient(circle at 80% 30%, #ffffff 0%, transparent 40%),
        radial-gradient(circle at 30% 80%, #2e34a7 0%, transparent 45%),
        linear-gradient(120deg, #120820 0%, #261044 45%, #3d0f5d 100%);
    background-size: 400% 400%;
    animation: auroraShift 10s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes auroraShift {
    0% {
        background-position: 0% 50%;
    }
    30% {
        background-position: 50% 100%;
    }
    60% {
        background-position: 100% 30%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.background {
    width: 100%;
    max-width: 1400px;
    margin: 24px auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    width: 100%;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: #ffeb9c;
    font-size: 12px;
    letter-spacing: 1px;
}

.content {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
    padding: 20px 30px 30px 30px;
}

.input_form,
.img_form {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 12px 36px rgba(8, 12, 40, 0.18);
}

.input_form {
    flex: 1 1 320px;
    max-width: 400px;
}

.img_form {
    flex: 1 1 400px;
}

.form_title {
    font-size: 24px;
    font-weight: 700;
    color: #2b0b46;
    margin-bottom: 10px;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

label {
    border-radius: 5px;
    padding: 5px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    border: 2px solid transparent;
    background: var(--primary-gradient) border-box;
    box-shadow: 0 10px 25px rgba(79, 124, 255, 0.25);
}

label + input,
label + textarea {
    margin-top: 4px;
}

.upload_label {
    cursor: pointer;
    justify-content: space-between;
    padding: 10px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(79, 124, 255, 0.25);
}

.upload_label:hover { transform: translateY(-3px); }
.upload_label:active { transform: translateY(-1px) scale(0.998); }

.upload_hint {
    font-size: 12px;
    opacity: 0.8;
}

input,
textarea {
    border: 1px solid rgba(83, 47, 104, 0.12);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.95);
    transition: border 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgb(51, 129, 255);
    box-shadow: 0 0 0 3px rgba(127, 44, 255, 0.15);
}

textarea {
    min-height: 80px;
    resize: vertical;
}
.info_block{
    position: absolute;
    bottom: 10px;
    display: flex;
    flex-direction: row;
    gap: 10px;
}
.info_text{
    display: flex;
    flex-direction: column;
}

button {
    margin-top: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #6b7ff5 0%, #5c8ff6 50%, #5fe0ff 100%);
    background-size: 300% 100%;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.12s ease;
    will-change: transform;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(31, 13, 91, 0.22);
    filter: saturate(1.06);
    animation: btnShift 1.8s linear infinite;
}

button:active { transform: translateY(-1px) scale(0.995); }

@keyframes btnShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.frame_canvas {
    width: 100%;
    position: relative;
    border-radius: var(--radius-xl);
    background: #f4f6ff;
    display: flex;
    justify-content: center;
    transform: none !important;
    scale: 1 !important;
}

.template_img {
    width: 100%;
    display: block;
    z-index: 2;
}

.image_choosen {
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    top: 47.5%;
    left: 19.3%;
    transform: translate(-50%, -50%);
    z-index: -100;
}

.image_choosen img { 
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -11;
}

.title {
    top: 65%;
    font-size: 16px;
    color: #553e87;
}

.message_box {
    position: absolute;
    width: 58%;
    left: 65%;
    top: 33%;
    transform: translateX(-50%);
    padding: 16px 20px;
    color: #ffffff;
    z-index: 10;
    height: 300px;
    /* background: #553e87; */

    display: flex;
    align-items: flex-start;
}

.message_content {
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
     font-size: clamp(14px, 1vw, 22px);
    line-height: 1.2;
    text-align:justify;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: darkblue;
}

/* Hiển thị tên và chức vụ bên dưới ảnh đại biểu */
.info_box {
    position: absolute;
    left: 19.5%;
    top: 75%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ffffff;
    z-index: 3;
    width: 250px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.info_box p:nth-child(1) {
    text-align: center;
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 16px;
    text-wrap: wrap;
    width: fit-content;
    line-height: 1.15;
    margin-bottom: 2px;
}

.info_box p:nth-child(2) {
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
    font-size: 15px;
    text-wrap: wrap;
    width: fit-content;
    line-height: 1.15;
    margin-bottom: 2px;
    opacity: 0.9;
}

/* ============== RESPONSIVE ============== */

/* Modal crop ảnh */
.crop_modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 7, 30, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 16px;
}

.crop_modal.open {
    display: flex;
}

.crop_modal_content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    padding: 16px;
    box-shadow: 0 18px 40px rgba(8, 10, 40, 0.35);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crop_image_wrapper {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
}

.crop_image_wrapper img {
    width: 100%;
    max-height: 420px;
    display: block;
}

.crop_actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.crop_actions button {
    min-width: 90px;
}