.plec-portal {
    max-width: 920px;
    margin: 40px auto;
    color: #1f2937;
    font-family: inherit;
}

.plec-card {
    padding: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.plec-card h2,
.plec-card h3,
.plec-card h4 {
    margin-top: 0;
    color: #111827;
}

.plec-intro,
.plec-welcome {
    margin-bottom: 22px;
}

.plec-heading-row,
.plec-document-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.plec-heading-row .plec-welcome {
    margin-bottom: 0;
}

.plec-section-intro {
    margin: 26px 0 16px;
}

.plec-login-card label,
.plec-sign-section label,
.plec-label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
    font-weight: 600;
}

.plec-login-card input[type="text"],
.plec-login-card input[type="password"],
.plec-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font: inherit;
}

.plec-login-card input:focus,
.plec-input:focus,
.plec-signature:focus {
    border-color: #1d4ed8;
    outline: 3px solid rgba(29, 78, 216, .15);
}

.plec-password-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.plec-password-wrap input[type="password"],
.plec-password-wrap input[type="text"] {
    padding-right: 88px !important;
}

.plec-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    min-width: 70px;
    padding: 6px 9px;
    border: 0;
    border-radius: 6px;
    background: #e2e8f0;
    color: #1f2937;
    cursor: pointer;
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.2;
}

.plec-password-toggle:hover,
.plec-password-toggle:focus {
    background: #cbd5e1;
    outline: 2px solid rgba(29, 78, 216, .18);
}

.plec-login-card .login-remember label {
    display: inline;
    font-weight: 400;
}

.plec-login-card .login-submit {
    margin-top: 20px;
}

.plec-button,
.plec-login-card input[type="submit"] {
    display: inline-block;
    box-sizing: border-box;
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
}

.plec-button:disabled {
    cursor: wait;
    opacity: .55;
}

.plec-button-primary,
.plec-login-card input[type="submit"] {
    background: #1d4ed8;
    color: #fff;
}

.plec-button-secondary {
    background: #1f2937;
    color: #fff;
}

.plec-button:hover,
.plec-button:focus,
.plec-login-card input[type="submit"]:hover,
.plec-login-card input[type="submit"]:focus {
    color: #fff;
    opacity: .92;
}

.plec-help {
    margin-top: 18px;
    margin-bottom: 0;
}

.plec-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 80px;
    margin-top: 22px;
}

.plec-spinner {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border: 3px solid #dbeafe;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: plec-spin .8s linear infinite;
}

@keyframes plec-spin {
    to { transform: rotate(360deg); }
}

.plec-document {
    margin-top: 22px;
    padding: 22px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #f8fafc;
}

.plec-document h3 {
    margin-bottom: 5px;
}

.plec-document-meta {
    margin: 0;
    color: #64748b;
    font-size: .94rem;
}

.plec-status {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
}

.plec-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.plec-status-signed {
    background: #dcfce7;
    color: #166534;
}

.plec-pdf-wrap {
    margin-top: 18px;
    max-height: 680px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #e2e8f0;
    -webkit-overflow-scrolling: touch;
}

.plec-pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.plec-pdf-page {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    background: #fff;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .18);
}

.plec-pdf-loading,
.plec-pdf-unavailable {
    padding: 24px 16px;
    text-align: center;
    color: #475569;
}

.plec-open-pdf {
    margin-top: 12px;
}

.plec-sign-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #dbe2ea;
}

.plec-small {
    color: #475569;
    font-size: .94rem;
}

.plec-signature {
    display: block;
    width: 100%;
    height: 180px;
    box-sizing: border-box;
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}

.plec-link-button {
    margin-top: 7px;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.plec-verification {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
}

.plec-code-input {
    max-width: 190px;
    letter-spacing: 5px;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
}

.plec-acceptance {
    display: grid !important;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
    margin: 20px 0 !important;
    font-weight: 400 !important;
    line-height: 1.45;
}

.plec-acceptance input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.plec-alert {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #f1f5f9;
}

.plec-alert p {
    margin: 8px 0 14px;
}

.plec-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.plec-alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.plec-inline-message {
    min-height: 1.5em;
    margin: 10px 0 0;
    font-size: .94rem;
}

.plec-message-error {
    color: #b91c1c;
    font-weight: 600;
}

.plec-message-success {
    color: #166534;
    font-weight: 600;
}


.plec-class-section {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
}

.plec-class-section h4 {
    margin-bottom: 12px;
}

.plec-class-item + .plec-class-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.plec-class-name {
    font-weight: 700;
    color: #111827;
}

.plec-class-code {
    margin-top: 2px;
    color: #64748b;
    font-size: .88rem;
}

.plec-class-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.plec-class-detail {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.plec-class-label,
.plec-class-value {
    display: block;
}

.plec-class-label {
    margin-bottom: 3px;
    color: #64748b;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.plec-class-value {
    color: #111827;
    font-weight: 600;
}

.plec-identity-note {
    margin: 18px 0 0;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    color: #334155;
    font-size: .94rem;
}

@media (max-width: 700px) {
    .plec-portal {
        margin: 20px auto;
    }

    .plec-card,
    .plec-document {
        padding: 18px;
    }

    .plec-heading-row,
    .plec-document-heading {
        flex-direction: column;
    }

    .plec-class-details {
        grid-template-columns: 1fr;
    }

    .plec-pdf-wrap {
        max-height: 520px;
        padding: 8px;
    }
}
