:root {
    --primary-color: #fc5f2e;
    --secondary-color: #fab50d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

#id-card-container {
    width: 100%;
    max-width: 590px;
    aspect-ratio: 590 / 1004;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 20px;
}

#id-card {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
}

.card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.top-swoosh {
    height: 40%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    /* MODIFICATION: The curved border has been removed. */
}

.background-logo {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.08;
    width: 80%;
    z-index: 1;
}

.background-logo img {
    width: 100%;
}

.header {
    padding: 5% 5% 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.header img {
    width: 100%; /* MODIFICATION: Logo size increased from 25% */
    max-width: 180px; /* MODIFICATION: Max logo size increased */
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.3));
}

.content {
    padding: 0 7%;
    text-align: center;
    position: relative;
    z-index: 2;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.photo {
    width: 40%;           /* MODIFICATION: Image size increased */
    aspect-ratio: 1 / 1;
    margin: -0% auto 3%; /* MODIFICATION: Image moved further up */
    border: 10px solid #ffffff; /* MODIFICATION: Image border made thicker */
    border-radius: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    position: relative;
    background: #fff;
    overflow: hidden;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* MODIFICATION: Added margin to push text down from the photo */
.details {
    margin-top: 35px;
}

/* MODIFICATION: Name font size increased */
.details h2#card-name {
    margin: 0;
    font-size: 5vw;
    font-weight: 600;
    color: #333;
}

/* MODIFICATION: New specific rule for the Title font size and position */
.details p#card-title {
    font-size: 4vw;
    margin: 10px 0 20px 0; /* Adjusts space above and below the title */
}

/* MODIFICATION: This now controls all OTHER text fields */
.details p {
    margin: 2% 0;
    font-size: 4.8vw;
    line-height: 1.4;
    color: #444;
}
.details p.address-field {
    font-size: 2.5vw;
}

.details p strong {
    font-weight: bold;
    color: #000;
}

.barcode-container {
    margin-top: auto;
    padding-bottom: 5%;
    width: 100%;
    display: flex;
    justify-content: center;
}

#barcode {
    width: 100%;
    height: 80px;
}

.footer {
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    padding: 2.5%;
    text-align: center;
    font-size: 2.5vw;
    position: relative;
    z-index: 2;
}
.footer p, .footer span {
    margin: 0;
    font-weight: bold;
}

/* --- Controls (No Changes Below This Line) --- */
.controls {
    width: 100%;
    max-width: 590px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 10px;
    box-sizing: border-box;
}

.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}
textarea { resize: vertical; }

.form-group.color-picker {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}
.form-group.color-picker div { flex: 1; }
input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Modal --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); }
.modal-content { background-color: #fefefe; margin: 15% auto; padding: 20px; border: 1px solid #888; width: 90%; max-width: 500px; border-radius: 10px; }
.close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
#image-to-crop { max-width: 100%; }

/* --- Media Query for Larger Screens --- */
@media (min-width: 992px) {
    .main-container {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
    }
    #id-card-container {
        width: 590px;
        height: 1004px;
        flex-shrink: 0;
    }
    .controls {
        width: 400px;
        max-width: none;
        flex-shrink: 0;
    }
    /* MODIFICATION: Set fixed font sizes for desktop for better control */
    .details h2#card-name { font-size: 3em; }
    .details p#card-title { font-size: 1.8em; }
    .details p { font-size: 1.4em; }
    .details p.address-field { font-size: 1.2em; }
    .footer { font-size: 1.3em; }

}
