.gmd-brasil {
    --gmd-blue: #1268b3;
    --gmd-blue-dark: #0c4f8c;
    --gmd-blue-soft: #eaf4fd;
    --gmd-text: #17324d;
    --gmd-muted: #66788a;
    --gmd-line: #dbe5ef;
    --gmd-white: #ffffff;
    width: 100%;
    color: var(--gmd-text);
    font-family: inherit;
}

.gmd-brasil * {
    box-sizing: border-box;
}

.gmd-header {
    text-align: center;
    margin: 0 auto 28px;
    max-width: 760px;
}

.gmd-header h2 {
    margin: 0 0 10px;
    color: var(--gmd-blue-dark);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
}

.gmd-header p {
    margin: 0;
    color: var(--gmd-muted);
    font-size: 16px;
    line-height: 1.6;
}

.gmd-stage {
    width: min(100%, 640px);
    margin: 0 auto;
}

.gmd-card[hidden] {
    display: none !important;
}

.gmd-card {
    overflow: hidden;
    background: var(--gmd-white);
    border: 1px solid var(--gmd-line);
    border-top: 4px solid var(--gmd-blue);
    border-radius: 22px;
    box-shadow: 0 18px 55px rgba(24, 73, 116, 0.10);
}

.gmd-card-inner {
    padding: 24px;
}

.gmd-drop {
    display: flex;
    min-height: 230px;
    padding: 28px 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    border: 1.5px dashed #a9bfd3;
    border-radius: 18px;
    background: #fbfdff;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.gmd-drop:hover,
.gmd-drop.is-dragging {
    border-color: var(--gmd-blue);
    background: var(--gmd-blue-soft);
}

.gmd-drop:active {
    transform: scale(.995);
}

.gmd-drop input {
    display: none !important;
}

.gmd-upload-icon {
    display: grid;
    width: 62px;
    height: 62px;
    margin-bottom: 6px;
    place-items: center;
    color: var(--gmd-blue);
    background: var(--gmd-blue-soft);
    border-radius: 50%;
}

.gmd-drop strong {
    display: block;
    color: var(--gmd-text);
    font-size: 18px;
}

.gmd-drop > span:last-child {
    color: var(--gmd-muted);
    font-size: 14px;
}

.gmd-selected {
    min-height: 22px;
    margin-top: 14px;
    color: var(--gmd-muted);
    font-size: 14px;
    word-break: break-word;
}

.gmd-button {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    margin-top: 14px;
    padding: 13px 18px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gmd-blue), var(--gmd-blue-dark));
    color: #fff !important;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(18, 104, 179, .18);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.gmd-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 26px rgba(18, 104, 179, .25);
}

.gmd-button:disabled {
    opacity: .48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gmd-note,
.gmd-small {
    color: var(--gmd-muted);
    font-size: 13px;
    line-height: 1.55;
}

.gmd-note {
    margin: 16px 0 0;
}

.gmd-small {
    margin: 10px 0 0;
    text-align: center;
}

.gmd-preview-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: #eef3f8;
}

.gmd-preview-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gmd-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    padding: 30px;
    place-items: center;
    text-align: center;
    color: var(--gmd-muted);
}

.gmd-message {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
}

.gmd-message.is-success {
    color: #155b91;
    border: 1px solid #b9d9f3;
    background: #edf7ff;
}

.gmd-message.is-error {
    color: #9f2f2f;
    border: 1px solid #f0b7b7;
    background: #fff3f3;
}

.gmd-download {
    margin-top: 14px;
}

@media (max-width: 760px) {
    .gmd-card-inner {
        padding: 18px;
    }

    .gmd-drop {
        min-height: 190px;
    }
}


.gmd-card-upload,
.gmd-card-result {
    animation: gmdFadeIn .24s ease;
}

.gmd-secondary-button {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    margin-top: 10px;
    padding: 12px 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gmd-blue);
    border-radius: 14px;
    background: #fff;
    color: var(--gmd-blue-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.gmd-secondary-button:hover {
    background: var(--gmd-blue-soft);
}

@keyframes gmdFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.gmd-upload-area {
    width: 100%;
}

.gmd-selected-preview[hidden] {
    display: none !important;
}

.gmd-selected-preview {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--gmd-line);
    border-radius: 18px;
    background: #eef3f8;
}

.gmd-selected-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gmd-change-image {
    position: absolute;
    right: 14px;
    bottom: 14px;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 12px;
    background: rgba(12,79,140,.94);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    backdrop-filter: blur(6px);
}

.gmd-change-image:hover {
    background: var(--gmd-blue-dark);
}

.gmd-selected.has-preview {
    margin-top: 10px;
    text-align: center;
}


/* Garante que a área de upload e a prévia nunca apareçam juntas.
   O display:flex de .gmd-drop poderia sobrescrever o atributo hidden
   em alguns temas/navegadores, por isso usamos uma regra explícita. */
.gmd-drop[hidden],
.gmd-selected-preview[hidden] {
    display: none !important;
}
