:root {
    --primary: #1646b5;
    --primary-dark: #0b132b;
    --accent: #f59e0b;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #1e293b;
}

h1, h2, h3, h4, h5, .fw-heading {
    font-family: 'Outfit', sans-serif;
}

.portal-login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #070e20 0%, #0d1a3a 55%, #1646b5 100%);
    display: grid;
    place-items: center;
    padding: 24px;
}

.portal-login-shell {
    width: min(1040px, 100%);
}

.portal-login-card {
    display: grid;
    grid-template-columns: 1fr 420px;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.portal-login-visual {
    min-height: 560px;
    background: linear-gradient(rgba(11, 19, 43, 0.6), rgba(11, 19, 43, 0.86)), url('../../assets/img/ConcursoDeBolsas2027.png') center/cover;
    color: #ffffff;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.portal-login-logo,
.portal-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.portal-login-logo {
    position: absolute;
    top: 42px;
}

.portal-badge {
    width: fit-content;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-login-visual h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    margin: 18px 0 12px;
}

.portal-login-visual p {
    max-width: 520px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
}

.portal-login-form {
    padding: 48px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portal-login-form h2 {
    color: #0f172a;
    font-weight: 800;
}

.form-control,
.input-group-text {
    border-radius: 12px;
    border-color: #dbe4f0;
}

.input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group .input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: #0f358f;
    --bs-btn-hover-border-color: #0f358f;
}

.portal-body {
    background: #f1f5f9;
    min-height: 100vh;
}

.portal-topbar {
    background: var(--primary-dark);
    padding: 14px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.portal-welcome {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.portal-welcome h1 {
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0 4px;
}

.portal-welcome p {
    color: #64748b;
    margin: 0;
}

.portal-protocol {
    background: #eef4ff;
    border-radius: 14px;
    padding: 14px 18px;
    min-width: 220px;
}

.portal-protocol span {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.portal-protocol strong {
    color: var(--primary);
    font-family: monospace;
}

.portal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.portal-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(22, 70, 181, 0.1);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    margin-bottom: 18px;
}

.portal-card h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.portal-card p {
    color: #64748b;
}

#submissionText {
    min-height: 360px;
    line-height: 1.7;
    resize: vertical;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: none;
}

.redacao-meta {
    display: flex;
    justify-content: flex-end;
}

.redacao-confirm-modal {
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.redacao-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #eef4ff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 1.7rem;
}

.redacao-confirm-modal h5 {
    color: #0f172a;
}

.redacao-confirm-modal p {
    line-height: 1.65;
}

.portal-score-card {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 58%, #eef4ff 100%);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 12px 28px rgba(22, 70, 181, 0.12);
}

.portal-score-card .portal-card-icon {
    background: #fef3c7;
    color: #d97706;
}

.portal-score {
    color: #d97706 !important;
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    line-height: 0.95;
    margin: 14px 0 0;
    text-shadow: 0 10px 26px rgba(217, 119, 6, 0.18);
}

.edital-content {
    line-height: 1.8;
    color: #334155;
}

@media (max-width: 900px) {
    .portal-login-card {
        grid-template-columns: 1fr;
    }

    .portal-login-visual {
        min-height: 340px;
    }

    .portal-login-logo {
        position: static;
        margin-bottom: 80px;
    }

    .portal-welcome {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .portal-topbar {
        padding: 10px 0;
    }

    .portal-topbar .container-fluid {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 12px;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .portal-logo {
        height: 38px;
    }

    .portal-topbar .btn {
        min-height: 38px;
    }

    main.container-fluid {
        padding: 16px !important;
    }

    .portal-welcome {
        border-radius: 14px;
        padding: 18px;
    }

    .portal-welcome h1 {
        font-size: 1.65rem;
        line-height: 1.15;
    }

    .portal-protocol {
        min-width: 0;
        width: 100%;
        overflow-wrap: anywhere;
    }

    .portal-card {
        border-radius: 14px;
        padding: 20px;
    }

    .portal-card-icon {
        width: 46px;
        height: 46px;
        font-size: 1.35rem;
        margin-bottom: 14px;
    }

    .portal-card h2 {
        font-size: 1.12rem;
    }

    .portal-score {
        font-size: 3rem;
    }

    .portal-envio-dialog {
        align-items: stretch;
        min-height: 100%;
        margin: 0;
        max-width: none;
    }

    .portal-envio-content {
        min-height: 100vh;
        border-radius: 0 !important;
    }

    .portal-envio-content .modal-header {
        padding: 14px 16px;
    }

    .portal-envio-content .modal-body {
        display: flex;
        flex-direction: column;
        padding: 16px;
    }

    .redacao-form {
        display: flex;
        flex: 1;
        flex-direction: column;
        min-height: calc(100vh - 86px);
    }

    .redacao-meta {
        justify-content: flex-start;
        order: -1;
    }

    #countdownTimer {
        font-size: 1rem !important;
        padding: 8px 12px;
    }

    #submissionText {
        flex: 1;
        min-height: 48vh;
        font-size: 1rem;
    }

    #textSubmissionMessage {
        font-size: 0.92rem;
    }

    .redacao-form .btn[type="submit"],
    #uploadForm .btn[type="submit"] {
        width: 100%;
        min-height: 46px;
    }

    .redacao-confirm-modal .modal-body {
        padding: 22px !important;
    }

    .redacao-confirm-modal .d-flex {
        flex-direction: column-reverse;
    }

    .redacao-confirm-modal .btn {
        width: 100%;
        min-height: 44px;
    }
}
