/*
 * Barney - the sign-in pages
 * ---------------------------------------------------------------------------
 * Login, signup, password recovery and activation all share one shape: a quiet
 * background and a single card in the middle of it. Nothing here leaks onto the
 * marketing pages - every rule is scoped either to .barney-auth or to the
 * body.barney-auth-page class the layout only sets on those routes.
 *
 * The background is a light ground with a moving network of connected points
 * drawn over it, and the card sits on top with a real border - white on
 * near-white needs an edge or it dissolves. The network is the only thing on
 * the page that moves, which is what makes the card the only thing to read.
 *
 * Written to work in both directions. There is no `left`/`right` in the layout
 * rules - only flex order and logical properties - so the Hebrew build mirrors
 * on its own rather than needing a second stylesheet.
 */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

.barney-auth {
    --auth-ink:       #0F2438;
    --auth-teal:      #0B7A6E;   /* AA for text and white-on-teal; the brand #12A594 is 3.07:1 */
    --auth-teal-soft: #2ED3BE;
    --auth-amber:     #E9A93A;
    --auth-card:      #FFFFFF;
    --auth-ground:    #F4F6FA;
    --auth-line:      #E5E7EB;
    --auth-muted:     #5B6B70;
    --auth-radius:    14px;

    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 20px;
    font-family: 'Rubik', -apple-system, 'Segoe UI', Arial, sans-serif;
}

/* The layout keeps its header markup; on these routes we simply do not draw it,
   so the card is the whole page. */
body.barney-auth-page { background: #F4F6FA; }
body.barney-auth-page .header,
body.barney-auth-page .footer { display: none; }

/* --------------------------------------------------------------------------
 * Background
 * ------------------------------------------------------------------------ */
.barney-auth::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -3;
    background:
        radial-gradient(900px 500px at 50% 0%, #FFFFFF 0%, transparent 70%),
        var(--auth-ground);
}

/* The network. Behind the card, in front of the ground, and never in the way
   of a click - the pointer is read from the window, not from the canvas. */
.barney-auth-net {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* Two slow-moving lights. They carry the whole sense of depth, so they are
   large, very soft, and never sharp enough to read as shapes. */
.barney-auth-glow {
    position: fixed;
    z-index: -1;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: .14;
    pointer-events: none;
}

.barney-auth-glow-a {
    top: -160px;
    inset-inline-start: -120px;
    background: var(--auth-teal);
    animation: barney-drift-a 18s ease-in-out infinite alternate;
}

.barney-auth-glow-b {
    bottom: -200px;
    inset-inline-end: -140px;
    background: #1D6E8C;
    animation: barney-drift-b 22s ease-in-out infinite alternate;
}

@keyframes barney-drift-a {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(60px, 80px, 0) scale(1.15); }
}

@keyframes barney-drift-b {
    from { transform: translate3d(0, 0, 0) scale(1.1); }
    to   { transform: translate3d(-70px, -60px, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .barney-auth-glow { animation: none; }
}

/* --------------------------------------------------------------------------
 * The card
 * ------------------------------------------------------------------------ */
.barney-auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 38px 34px 30px;
    background: var(--auth-card);
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-line);
    box-shadow: 0 6px 18px rgba(12, 20, 36, .06);
    animation: barney-rise .45s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes barney-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.barney-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    text-decoration: none;
}

.barney-auth-brand:hover { text-decoration: none; }

.barney-auth-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-teal) 0%, var(--auth-teal-soft) 100%);
    box-shadow: 0 6px 16px -6px rgba(18, 165, 148, .8);
}

.barney-auth-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--auth-ink);
}

.barney-auth-title {
    margin: 0 0 4px;
    font-size: 21px;
    font-weight: 600;
    text-align: center;
    color: var(--auth-ink);
}

.barney-auth-sub {
    margin: 0 0 26px;
    font-size: 14px;
    text-align: center;
    color: var(--auth-muted);
}

/* --------------------------------------------------------------------------
 * Fields
 * ------------------------------------------------------------------------ */
.barney-auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-ink);
}

.barney-auth-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    margin-bottom: 18px;
    font-size: 14px;
    font-family: inherit;
    color: var(--auth-ink);
    background: #FBFCFC;
    border: 1px solid var(--auth-line);
    border-radius: 11px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.barney-auth-input::placeholder { color: #62707A; }

.barney-auth-input:focus {
    background: #fff;
    border-color: var(--auth-teal);
    box-shadow: 0 0 0 3px rgba(18, 165, 148, .14);
}

/* The password field carries the reveal button inside it, so the input needs
   room on the trailing edge and the button has to sit above it. */
.barney-auth-field { position: relative; }
.barney-auth-field .barney-auth-input { padding-inline-end: 44px; }

.barney-auth-reveal {
    position: absolute;
    top: 23px;
    inset-inline-end: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--auth-muted);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}

.barney-auth-reveal:hover {
    color: var(--auth-teal);
    background: rgba(18, 165, 148, .1);
}

.barney-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
    font-size: 13px;
}

.barney-auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--auth-muted);
    cursor: pointer;
}

.barney-auth-remember input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--auth-teal);
    cursor: pointer;
}

.barney-auth-row a {
    color: var(--auth-teal);
    font-weight: 500;
    text-decoration: none;
}

.barney-auth-row a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
 * Submit
 * ------------------------------------------------------------------------ */
.barney-auth-submit {
    position: relative;
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-teal) 0%, #0E8C7E 100%);
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .18s ease, filter .18s ease;
    box-shadow: 0 10px 22px -12px rgba(18, 165, 148, .95);
}

.barney-auth-submit:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -12px rgba(18, 165, 148, 1);
}

.barney-auth-submit:active { transform: translateY(0); }

/* A single pass of light across the button on hover - the one flourish on the
   page, borrowed from the mockup. */
.barney-auth-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
    transition: left .55s ease;
}

.barney-auth-submit:hover::after { left: 140%; }

/* --------------------------------------------------------------------------
 * Social sign-in, sign-up, footer line
 * ------------------------------------------------------------------------ */
.barney-auth-or {
    position: relative;
    margin: 24px 0 16px;
    text-align: center;
}

.barney-auth-or::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--auth-line);
}

.barney-auth-or span {
    position: relative;
    padding: 0 12px;
    font-size: 12px;
    color: var(--auth-muted);
    background: var(--auth-card);
}

.barney-auth-social {
    display: flex;
    gap: 10px;
}

.barney-auth-social a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-ink);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 11px;
    transition: border-color .18s ease, background .18s ease;
}

.barney-auth-social a:hover {
    background: #F7FAF9;
    border-color: #C9D3D1;
}

.barney-auth-social img { width: 17px; height: 17px; }

.barney-auth-signup {
    margin-top: 22px;
    font-size: 13px;
    text-align: center;
    color: var(--auth-muted);
}

.barney-auth-signup a {
    color: var(--auth-teal);
    font-weight: 600;
    text-decoration: none;
}

.barney-auth-signup a:hover { text-decoration: underline; }

.barney-auth-by {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-line);
    font-size: 12px;
    text-align: center;
    color: #62707A;
}

.barney-auth-by strong { color: var(--auth-ink); font-weight: 600; }
/* The company's name is a link to its site: the same look, underlined under the pointer or focus. */
.barney-auth-by a { color: inherit; text-decoration: none; }
.barney-auth-by a:hover strong,
.barney-auth-by a:focus-visible strong { text-decoration: underline; }

/* The framework prints validation and login errors into this container, and it
   is empty until then - so it must not reserve space when it has nothing. */
/*
 * What went wrong, on the card.
 *
 * The shared handler writes into this with a Bootstrap text colour; the sign-in
 * form writes into it directly. Either way it has to be readable without
 * hunting for it, because until now a failed sign-in looked exactly like a
 * successful one: nothing.
 */
.barney-auth-card .show-message:not(:empty) {
    margin-bottom: 16px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.5;
    background: #E9F7F4;
    color: #0B6E6B;
    /* Hebrew reads from the right edge (the template's message styles pushed it left). */
    text-align: start;
}
[dir="rtl"] .barney-auth-card .show-message, .barney-auth[dir="rtl"] .show-message { text-align: right; }

/* "Send the email again" under the not-activated message: a clear button, not a red word. */
.barney-auth-card .show-message .barney-auth-again {
    display: inline-flex; align-items: center; justify-content: center; margin-top: 10px; min-height: 40px;
    padding: 8px 16px; border-radius: 999px; background: #0B7A6E; color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.barney-auth-card .show-message .barney-auth-again:hover { background: #09635A; color: #fff; }

.barney-auth-card .show-message.is-bad {
    background: #FDECEC;
    color: #B3261E;

    /* A failure can now carry the status and the start of the body, and a
       server's own wording does not wrap where ours would. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 220px;
    overflow-y: auto;
}

/* The button says it is working. Without this the press had no acknowledgement
   at all, which is most of why it read as broken. */
.barney-auth-submit:disabled {
    filter: none;
    transform: none;
    cursor: default;
    opacity: .85;
}

.barney-auth-submit:disabled::after { display: none; }
.barney-auth-card .g-recaptcha { margin-bottom: 16px; }

/* --------------------------------------------------------------------------
 * Signup and activation
 * ------------------------------------------------------------------------ */

/* Signup has six fields. A slightly wider card and paired rows keep it from
   turning into a column you have to scroll. */
.barney-auth-card-wide { max-width: 480px; }

.barney-auth-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.barney-auth-select {
    /* A select is not an input, so it needs the height restated and its own
       arrow - the browser default sits badly against the rounded field. */
    height: 46px;
    line-height: 44px;
    padding-inline-end: 34px;
    color: var(--auth-ink);
    background-image: linear-gradient(45deg, transparent 50%, #7A8A8D 50%),
                      linear-gradient(135deg, #7A8A8D 50%, transparent 50%);
    background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

[dir="rtl"] .barney-auth-select {
    background-position: 18px 21px, 13px 21px;
    background-image: linear-gradient(135deg, transparent 50%, #7A8A8D 50%),
                      linear-gradient(45deg, #7A8A8D 50%, transparent 50%);
}

/* The activation page has an outcome instead of a form. */
.barney-auth-result { text-align: center; }

.barney-auth-status {
    margin: 6px 0 24px;
    font-size: 52px;
    line-height: 1;
}

.barney-auth-status.is-good { color: var(--auth-teal); }
.barney-auth-status.is-bad  { color: #D9534F; }

/* The activation actions are links, not buttons, so they need the parts a
   button gets for free. */
a.barney-auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 480px) {
    .barney-auth { padding: 28px 16px; }
    .barney-auth-card { padding: 30px 22px 24px; }
    .barney-auth-social { flex-direction: column; }
    .barney-auth-pair { grid-template-columns: 1fr; }
}

/* Labels follow the page's direction; the site stylesheet pinned them to the left. */
.barney-auth .barney-auth-label { text-align: start; }

/* The language switch, top corner of the card. */
.barney-auth-card { position: relative; }
.barney-auth-langs { direction: ltr; position: absolute; top: 14px; inset-inline-start: 14px; display: flex; gap: 2px; background: #f0f2f5; border-radius: 999px; padding: 3px; }
.barney-auth-langs a { font-size: 12px; font-weight: 600; color: #5B6B70; text-decoration: none; padding: 3px 10px; border-radius: 999px; }
.barney-auth-langs a:hover { color: #0B6E63; }
.barney-auth-langs a.is-on { background: #fff; color: #111b21; box-shadow: 0 1px 2px rgba(15, 36, 56, .12); }
.barney-auth-langs ~ .barney-auth-brand { margin-top: 16px; }

/* The terms, privacy and accessibility links under every sign-in card. */
.barney-auth-legal { margin-top: 10px; text-align: center; font-size: 12px; color: var(--auth-muted); }
.barney-auth-legal a { color: var(--auth-muted); text-decoration: underline; text-underline-offset: 2px; }
.barney-auth-legal a:hover { color: var(--auth-teal); }
