/* ==========================================================================
   ORIUN - Sistema de autenticacao (Login / Registo)
   Fonte unica de estilos para as paginas de entrada e registo.
   Mobile-first. Nao depende de main.css nem de componentes de precos.
   ========================================================================== */

:root {
    --auth-brand: #60014a;
    --auth-brand-strong: #4b0039;
    --auth-brand-deep: #3a002c;
    --auth-brand-bright: #8d0069;
    --auth-accent: #33bfc5;
    --auth-accent-deep: #10646a;

    --auth-card-bg: #ffffff;
    --auth-field-bg: #fbfbfd;
    --auth-field-bg-focus: #ffffff;
    --auth-border: #d3d8e3;
    --auth-border-strong: #b9c0d0;

    --auth-text: #16192b;
    --auth-text-soft: #4f576b;
    --auth-text-muted: #5c6478;
    --auth-placeholder: #626b7e;

    --auth-danger: #b3123c;
    --auth-danger-soft: #fdf2f4;
    --auth-success: #0f6b45;
    --auth-success-soft: #f0faf5;
    --auth-warning: #8a5300;
    --auth-warning-soft: #fdf6ea;
    --auth-info-soft: #f2f6fd;

    --auth-radius-card: 24px;
    --auth-radius-field: 12px;

    --auth-space-1: 4px;
    --auth-space-2: 8px;
    --auth-space-3: 12px;
    --auth-space-4: 16px;
    --auth-space-5: 24px;
    --auth-space-6: 32px;
    --auth-space-7: 48px;

    --auth-focus-ring: 0 0 0 3px rgba(96, 1, 74, 0.28);
    --auth-font: "Open Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --auth-font-heading: "Poppins", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.oriun-auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--auth-brand-strong);
    color: #ffffff;
    font-family: var(--auth-font);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.oriun-auth-page img {
    max-width: 100%;
    height: auto;
}

/* Apenas ligacoes sem classe herdam a cor; as classificadas definem a sua. */
.oriun-auth-page a:not([class]) {
    color: inherit;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.oriun-auth-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: var(--auth-space-6) var(--auth-space-4);
    overflow-x: clip;
    background:
        radial-gradient(120% 90% at 12% 8%, rgba(141, 0, 105, 0.55) 0%, rgba(141, 0, 105, 0) 60%),
        radial-gradient(110% 80% at 92% 96%, rgba(51, 191, 197, 0.22) 0%, rgba(51, 191, 197, 0) 62%),
        linear-gradient(168deg, #4b0039 0%, #6d0052 46%, #3a002c 100%);
}

.oriun-auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 0, 16, 0.16) 0%, rgba(20, 0, 16, 0) 32%, rgba(20, 0, 16, 0.24) 100%);
    pointer-events: none;
}

.oriun-auth-aside,
.oriun-auth-main {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Painel de marca
   -------------------------------------------------------------------------- */

.oriun-auth-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--auth-space-5);
}

.oriun-auth-brand {
    display: inline-flex;
    align-items: center;
    border-radius: var(--auth-space-2);
    text-decoration: none;
}

.oriun-auth-brand img {
    width: 132px;
}

.oriun-auth-aside__pitch {
    display: none;
}

.oriun-auth-aside__claim {
    margin: var(--auth-space-5) 0 0;
    color: #ffffff;
    font-family: var(--auth-font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.24;
    letter-spacing: -0.01em;
}

.oriun-auth-aside__lead {
    margin: var(--auth-space-3) 0 0;
    max-width: 46ch;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.oriun-auth-benefits {
    display: grid;
    gap: var(--auth-space-4);
    margin: var(--auth-space-6) 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.oriun-auth-benefit {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: var(--auth-space-4);
}

.oriun-auth-benefit__icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.oriun-auth-benefit strong {
    display: block;
    margin-bottom: 2px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
}

.oriun-auth-benefit p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.oriun-auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--auth-space-2);
    margin: var(--auth-space-6) 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Cartao
   -------------------------------------------------------------------------- */

.oriun-auth-main {
    display: flex;
    justify-content: center;
}

.oriun-auth-card {
    width: min(100%, 480px);
    padding: var(--auth-space-6) var(--auth-space-5);
    border-radius: var(--auth-radius-card);
    background: var(--auth-card-bg);
    color: var(--auth-text);
    box-shadow: 0 24px 60px rgba(23, 0, 20, 0.34);
}

.oriun-auth-card__head {
    margin-bottom: var(--auth-space-5);
    text-align: center;
}

.oriun-auth-card__head h1 {
    margin: 0 0 var(--auth-space-2);
    color: var(--auth-text);
    font-family: var(--auth-font-heading);
    font-size: clamp(1.5rem, 5.4vw, 1.875rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.oriun-auth-card__head p {
    margin: 0 auto;
    max-width: 42ch;
    color: var(--auth-text-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.oriun-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--auth-space-3);
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(96, 1, 74, 0.08);
    color: var(--auth-brand);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Formulario
   -------------------------------------------------------------------------- */

.oriun-auth-form {
    width: 100%;
}

.oriun-auth-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.oriun-auth-field {
    margin-bottom: var(--auth-space-4);
}

.oriun-auth-field > label {
    display: block;
    margin-bottom: 6px;
    color: var(--auth-text);
    font-size: 0.9375rem;
    font-weight: 600;
}

.oriun-auth-field > label .req {
    color: var(--auth-danger);
}

.oriun-auth-input {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: var(--auth-space-3);
    min-height: 52px;
    padding: 0 var(--auth-space-4);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-field);
    background: var(--auth-field-bg);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.oriun-auth-input--with-action {
    grid-template-columns: 24px minmax(0, 1fr) 44px;
}

.oriun-auth-input:focus-within {
    border-color: var(--auth-brand);
    background: var(--auth-field-bg-focus);
    box-shadow: var(--auth-focus-ring);
}

.oriun-auth-input > .oriun-auth-input__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-text-soft);
}

.oriun-auth-input__icon svg,
.oriun-auth-toggle svg,
.oriun-auth-benefit__icon svg,
.oriun-auth-submit svg,
.oriun-auth-trust svg,
.oriun-auth-back svg,
.oriun-auth-error svg {
    display: block;
    flex: 0 0 auto;
}

.oriun-auth-toggle .icon-eye {
    display: none;
}

.oriun-auth-toggle.is-revealed .icon-eye {
    display: block;
}

.oriun-auth-toggle.is-revealed .icon-eye-off {
    display: none;
}

.oriun-auth-input input {
    width: 100%;
    min-width: 0;
    padding: 14px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--auth-text);
    font-family: inherit;
    /* 16px minimo: evita zoom automatico no iOS Safari ao focar o campo */
    font-size: 16px;
    line-height: 1.4;
}

.oriun-auth-input input::placeholder {
    color: var(--auth-placeholder);
    opacity: 1;
}

.oriun-auth-input input:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 40px var(--auth-field-bg-focus) inset;
}

.oriun-auth-field.is-invalid .oriun-auth-input {
    border-color: var(--auth-danger);
    background: var(--auth-danger-soft);
}

.oriun-auth-field.is-invalid .oriun-auth-input:focus-within {
    box-shadow: 0 0 0 3px rgba(179, 18, 60, 0.22);
}

.oriun-auth-error {
    display: none;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    color: var(--auth-danger);
    font-size: 0.875rem;
    line-height: 1.45;
}

.oriun-auth-field.is-invalid .oriun-auth-error {
    display: flex;
}

.oriun-auth-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: -10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--auth-text-soft);
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.oriun-auth-toggle:hover,
.oriun-auth-toggle:focus-visible {
    background: rgba(96, 1, 74, 0.08);
    color: var(--auth-brand);
}

/* Forca da palavra-passe --------------------------------------------------- */

.oriun-auth-strength {
    margin-top: 10px;
}

.oriun-auth-strength__track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.oriun-auth-strength__track span {
    height: 5px;
    border-radius: 999px;
    background: #e3e7ef;
    transition: background-color 0.2s ease;
}

.oriun-auth-strength__label {
    display: block;
    margin-top: 6px;
    color: var(--auth-text-muted);
    font-size: 0.8125rem;
}

.oriun-auth-strength[data-score="1"] .oriun-auth-strength__track span:nth-child(-n + 1) {
    background: #c02640;
}

.oriun-auth-strength[data-score="2"] .oriun-auth-strength__track span:nth-child(-n + 2) {
    background: #c97a06;
}

.oriun-auth-strength[data-score="3"] .oriun-auth-strength__track span:nth-child(-n + 3) {
    background: #1f7d55;
}

.oriun-auth-strength[data-score="4"] .oriun-auth-strength__track span {
    background: #0f6b45;
}

.oriun-auth-rules {
    display: grid;
    gap: 4px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.oriun-auth-rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.oriun-auth-rules li::before {
    content: "";
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--auth-border-strong);
    border-radius: 50%;
    background: transparent;
}

.oriun-auth-rules li.is-met {
    color: var(--auth-success);
}

.oriun-auth-rules li.is-met::before {
    border-color: var(--auth-success);
    background: var(--auth-success);
    box-shadow: inset 0 0 0 2px #ffffff, inset 0 0 0 3px var(--auth-success);
}

/* Opcoes e consentimento --------------------------------------------------- */

.oriun-auth-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--auth-space-3);
    margin: var(--auth-space-2) 0 var(--auth-space-5);
    font-size: 0.9375rem;
}

.oriun-auth-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: var(--auth-text-soft);
    line-height: 1.45;
    cursor: pointer;
}

.oriun-auth-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--auth-brand);
    cursor: pointer;
}

.oriun-auth-consent {
    margin-bottom: var(--auth-space-5);
}

.oriun-auth-consent .oriun-auth-error {
    margin-left: 30px;
}

/* Botao primario ----------------------------------------------------------- */

.oriun-auth-submit {
    position: relative;
    width: 100%;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 var(--auth-space-5);
    border: 0;
    border-radius: var(--auth-radius-field);
    background: linear-gradient(180deg, #8d0069 0%, #60014a 100%);
    color: #ffffff;
    font-family: var(--auth-font-heading);
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-shadow: 0 12px 24px rgba(58, 0, 44, 0.28);
}

.oriun-auth-submit__icon {
    display: inline-flex;
}

.oriun-auth-submit:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 16px 30px rgba(58, 0, 44, 0.34);
    transform: translateY(-1px);
}

.oriun-auth-submit:disabled {
    cursor: progress;
    filter: saturate(0.75);
}

.oriun-auth-submit__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: oriun-auth-spin 0.7s linear infinite;
}

.oriun-auth-submit.is-loading .oriun-auth-submit__spinner {
    display: inline-block;
}

.oriun-auth-submit.is-loading .oriun-auth-submit__icon {
    display: none;
}

@keyframes oriun-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ligacoes secundarias ----------------------------------------------------- */

.oriun-auth-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--auth-brand);
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
}

.oriun-auth-link:hover,
.oriun-auth-link:focus-visible {
    color: var(--auth-brand-deep);
    text-decoration: underline;
}

.oriun-auth-alt {
    margin: var(--auth-space-5) 0 0;
    padding-top: var(--auth-space-5);
    border-top: 1px solid #e6e9f0;
    color: var(--auth-text-muted);
    text-align: center;
    font-size: 0.9375rem;
}

.oriun-auth-alt strong {
    color: var(--auth-text);
    font-weight: 600;
}

.oriun-auth-back {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    gap: 8px;
    margin-top: var(--auth-space-5);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9375rem;
    text-decoration: none;
}

.oriun-auth-back:hover,
.oriun-auth-back:focus-visible {
    color: #ffffff;
    text-decoration: underline;
}

.oriun-auth-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: var(--auth-space-5);
    text-align: center;
}

/* Feedback ----------------------------------------------------------------- */

.oriun-auth-feedback {
    display: none;
    margin-bottom: var(--auth-space-4);
    padding: var(--auth-space-4);
    border: 1px solid transparent;
    border-radius: var(--auth-radius-field);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.oriun-auth-feedback.is-visible {
    display: block;
}

.oriun-auth-feedback__title {
    display: block;
    margin-bottom: 2px;
    font-weight: 700;
}

.oriun-auth-feedback__help {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    opacity: 0.9;
}

.oriun-auth-feedback--danger {
    border-color: rgba(179, 18, 60, 0.28);
    background: var(--auth-danger-soft);
    color: #8e0f31;
}

.oriun-auth-feedback--warning {
    border-color: rgba(138, 83, 0, 0.28);
    background: var(--auth-warning-soft);
    color: var(--auth-warning);
}

.oriun-auth-feedback--success {
    border-color: rgba(15, 107, 69, 0.28);
    background: var(--auth-success-soft);
    color: var(--auth-success);
}

.oriun-auth-feedback--info {
    border-color: rgba(22, 25, 43, 0.16);
    background: var(--auth-info-soft);
    color: #2b3350;
}

.oriun-auth-note {
    margin-bottom: var(--auth-space-4);
    padding: var(--auth-space-4);
    border: 1px solid rgba(138, 83, 0, 0.24);
    border-radius: var(--auth-radius-field);
    background: var(--auth-warning-soft);
    color: var(--auth-warning);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Foco visivel global ------------------------------------------------------ */

/* Campos de texto nao levam outline proprio: o indicador de foco e o
   :focus-within do contentor, que pinta borda, fundo e anel. Um outline no
   input desenharia barras verticais dentro do campo, porque o input ocupa
   apenas a coluna central da grelha. */
.oriun-auth-input input:focus,
.oriun-auth-input input:focus-visible {
    outline: 0;
}

.oriun-auth-page a:focus-visible,
.oriun-auth-page button:focus-visible,
.oriun-auth-page input[type="checkbox"]:focus-visible {
    outline: 3px solid #ffd6f2;
    outline-offset: 2px;
}

.oriun-auth-card a:focus-visible,
.oriun-auth-card button:focus-visible,
.oriun-auth-card input[type="checkbox"]:focus-visible {
    outline-color: var(--auth-brand);
}

.oriun-auth-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Telemovel largo
   -------------------------------------------------------------------------- */

@media (min-width: 576px) {
    .oriun-auth-shell {
        padding: var(--auth-space-7) var(--auth-space-5);
    }

    .oriun-auth-card {
        width: min(100%, 520px);
        padding: var(--auth-space-6);
    }

    .oriun-auth-grid--split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--auth-space-4);
    }

    .oriun-auth-brand img {
        width: 148px;
    }
}

/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
    .oriun-auth-card {
        width: min(100%, 560px);
        padding: var(--auth-space-7) var(--auth-space-6);
    }

    .oriun-auth-card__head h1 {
        font-size: 2rem;
    }

    .oriun-auth-card__head p {
        font-size: 1rem;
    }
}

/* --------------------------------------------------------------------------
   Desktop - duas colunas
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {
    .oriun-auth-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        gap: clamp(32px, 5vw, 88px);
        padding: var(--auth-space-7) clamp(32px, 5vw, 72px);
    }

    .oriun-auth-aside {
        align-items: flex-start;
        justify-self: end;
        max-width: 520px;
        margin-bottom: 0;
        text-align: left;
    }

    .oriun-auth-aside__pitch {
        display: block;
    }

    .oriun-auth-brand img {
        width: 168px;
    }

    .oriun-auth-aside__claim {
        margin-top: var(--auth-space-6);
        font-size: clamp(1.875rem, 2.6vw, 2.5rem);
    }

    .oriun-auth-trust {
        justify-content: flex-start;
    }

    .oriun-auth-main {
        justify-content: flex-start;
        justify-self: start;
        max-width: 560px;
    }

    .oriun-auth-card {
        width: min(100%, 560px);
    }

    .oriun-auth-card__brand {
        display: none;
    }

    .oriun-auth-footer {
        display: none;
    }
}

@media (min-width: 1400px) {
    .oriun-auth-shell {
        gap: 104px;
        padding-inline: clamp(64px, 8vw, 160px);
    }
}

/* --------------------------------------------------------------------------
   Ecra muito estreito
   -------------------------------------------------------------------------- */

@media (max-width: 374.98px) {
    .oriun-auth-shell {
        padding: var(--auth-space-5) var(--auth-space-3);
    }

    .oriun-auth-card {
        padding: var(--auth-space-5) var(--auth-space-4);
        border-radius: 18px;
    }

    .oriun-auth-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --------------------------------------------------------------------------
   Preferencias do utilizador
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .oriun-auth-page *,
    .oriun-auth-page *::before,
    .oriun-auth-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .oriun-auth-submit:hover:not(:disabled) {
        transform: none;
    }
}

@media (forced-colors: active) {
    .oriun-auth-card {
        border: 1px solid CanvasText;
    }

    .oriun-auth-input {
        border-color: CanvasText;
    }
}

/* --------------------------------------------------------------------------
   Dialogos jquery-confirm em ecras pequenos
   -------------------------------------------------------------------------- */

.jconfirm .jconfirm-box {
    max-width: calc(100vw - 32px);
}

/* Reforco da promessa do trial junto ao botao de submissao. */
.oriun-auth-reassurance {
    margin: 0.75rem 0 0;
    color: var(--auth-text-muted, #5c6478);
    font-size: 0.8125rem;
    line-height: 1.5;
    text-align: center;
}

/* Nota de seguranca abaixo da opcao "Manter sessao iniciada" */
.oriun-auth-hint {
    margin: -0.35rem 0 1rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #6b6b73;
}
