/*
 * Login page (application/views/login.php)
 *
 * Breakpoints:
 *   >= 992px : two columns - dark brand panel (left) + form (right)
 *   < 992px  : one column  - brand header, tournament logo, form, footer
 *   < 576px  : phone       - compact header, form, tournament logo under the form
 *
 * On tablet/phone .lp-panel uses display: contents, so its children (.lp-brand, .lp-tour, .lp-foot)
 * become direct flex items of .lp and are ordered together with .lp-main via `order`.
 */

:root {
    --lp-navy:       #0E2A3B;   /* brand panel */
    --lp-navy-text:  #9FB6C4;   /* secondary text on navy */
    --lp-logo:       #2BA0C7;   /* logo color (assets/img/logo.svg) */
    --lp-accent:     #00796B;   /* darker app teal (#009688) so white text passes contrast */
    --lp-accent-dk:  #00695C;
    --lp-text:       #1F2A33;
    --lp-muted:      #56636E;
    --lp-border:     #C5CDD3;
    --lp-bg:         #F4F6F8;
}

html, body.lp-body {
    height: 100%;
}

body.lp-body {
    margin: 0;
    background: var(--lp-bg);
    color: var(--lp-text);
    font-family: Roboto, Arial, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.lp {
    display: flex;
    min-height: 100vh;
}

/* ---------- Brand panel (desktop) ---------- */

.lp-panel {
    position: relative;
    flex: 0 0 40%;
    max-width: 600px;
    min-width: 420px;
    box-sizing: border-box;
    padding: 56px 64px;
    background: var(--lp-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    overflow: hidden;
}

/* Big faint logo in the bottom-right corner of the panel - decoration only */
.lp-panel::before {
    content: "";
    position: absolute;
    right: -260px;
    bottom: -220px;
    width: 760px;
    height: 760px;
    background: url("../img/logo.svg") no-repeat center / contain;
    opacity: .07;
    pointer-events: none;
}

.lp-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}
.lp-brand-logo {
    width: 56px;
    height: 56px;
}
.lp-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lp-brand-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.2;
}
.lp-brand-sub,
.lp-caption {
    font-size: 13px;
    color: var(--lp-navy-text);
    letter-spacing: 1.6px;
    text-transform: uppercase;
}
.lp-caption {
    font-size: 12px;
}

/* Shown only on the demo instance (Apache SetEnv CI_INST demo) */
.lp-demo {
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    background: #F2B33D;
    color: #2A1E00;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

/* ---------- Tournament logo / placeholder ---------- */

.lp-tour {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.lp-tour-box {
    width: 300px;
    height: 300px;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
}
.lp-tour-logo {
    background: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lp-tour-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.lp-tour-placeholder {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    overflow: hidden;
    border: 1px solid rgba(159, 216, 234, .25);
    background: radial-gradient(circle at 50% 45%, rgba(43, 160, 199, .28) 0%, rgba(43, 160, 199, .06) 45%, rgba(255, 255, 255, .03) 75%);
}
.lp-tour-placeholder::after {   /* inner dashed frame */
    content: "";
    position: absolute;
    top: 16px; right: 16px; bottom: 16px; left: 16px;
    border: 1px dashed rgba(159, 216, 234, .22);
    border-radius: 8px;
}
.lp-tour-placeholder img {
    width: 120px;
    height: 120px;
}
.lp-tour-placeholder span {
    font-size: 13px;
    color: #9FD8EA;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ---------- Footer: version + copyright ---------- */

.lp-foot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--lp-navy-text);
}
.lp-version {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #fff;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 4px;
}

/* Contact e-mail in the footer: light blue on the navy panel, teal on the light footer (tablet/phone, see media queries) */
.lp-foot a,
.lp-foot a:visited {
    color: #9FD8EA;
    text-decoration: none;
}
.lp-foot a:hover,
.lp-foot a:focus {
    color: #fff;
    text-decoration: underline;
}

/* ---------- Form ---------- */

.lp-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    box-sizing: border-box;
}
.lp-form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.lp-head h1 {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    color: var(--lp-navy);
}
.lp-head p {
    margin: 0;
    font-size: 15px;
    color: var(--lp-muted);
}

.lp-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lp-field label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--lp-text);
}
.lp-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px;            /* 16px stops iOS from zooming into the field */
    color: var(--lp-text);
    background: #fff;
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.lp-input:focus {
    outline: none;
    border-color: var(--lp-accent);
    box-shadow: 0 0 0 3px rgba(0, 121, 107, .18);
}

.lp-pass {
    position: relative;
}
.lp-pass .lp-input {
    padding-right: 52px;
}
.lp-eye {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--lp-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.lp-eye:hover,
.lp-eye:focus {
    color: var(--lp-text);
    outline: none;
}
.lp-eye:focus-visible {
    box-shadow: 0 0 0 2px var(--lp-accent);
}
.lp-eye svg {
    width: 20px;
    height: 20px;
}
.lp-eye .lp-eye-hide,
.lp-eye[aria-pressed="true"] .lp-eye-show {
    display: none;
}
.lp-eye[aria-pressed="true"] .lp-eye-hide {
    display: block;
}

.lp-submit {
    height: 48px;
    border: 0;
    border-radius: 8px;
    background: var(--lp-accent);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .4px;
    cursor: pointer;
    transition: background-color .15s;
}
.lp-submit:hover,
.lp-submit:focus {
    background: var(--lp-accent-dk);
    outline: none;
}
.lp-submit:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 121, 107, .35);
}
.lp-submit[disabled] {
    opacity: .7;
    cursor: wait;
}

/* #error is shown/hidden by jQuery fadeIn/fadeOut (display block), the flex layout lives in the inner div */
.lp-error-in {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 8px;
    background: #FDECEA;
    color: #8A1C12;
    font-size: 14px;
    line-height: 1.4;
}
.lp-error-in svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.lp-help {
    margin: 0;
    font-size: 13px;
    color: var(--lp-muted);
    text-align: center;
}

/* ---------- Tablet (< 992px): one column ---------- */

@media (max-width: 991px) {
    .lp {
        flex-direction: column;
    }
    .lp-panel {
        display: contents;      /* children become items of .lp */
    }
    .lp-panel::before {
        display: none;
    }
    .lp-brand,
    .lp-tour {
        background: var(--lp-navy);
        color: #fff;
        padding: 48px 56px 0;
    }
    .lp-brand { order: 1; }
    .lp-tour  { order: 2; align-items: center; padding-top: 36px; padding-bottom: 48px; }
    .lp-main  { order: 3; align-items: flex-start; padding: 64px 32px 32px; }
    .lp-foot  { order: 4; margin-top: auto; justify-content: center; padding: 24px 32px 32px; color: var(--lp-muted); }

    .lp-tour .lp-caption { display: none; }
    .lp-tour-box { width: 240px; height: 240px; }
    .lp-tour-placeholder img { width: 96px; height: 96px; }
    .lp-tour-placeholder span { font-size: 12px; }

    .lp-form { max-width: 480px; }
    .lp-version {
        color: var(--lp-navy);
        border-color: var(--lp-border);
    }
    .lp-foot a,
    .lp-foot a:visited { color: var(--lp-accent); }
    .lp-foot a:hover,
    .lp-foot a:focus  { color: var(--lp-accent-dk); }
}

/* ---------- Phone (< 576px): compact, tournament logo below the form ---------- */

@media (max-width: 575px) {
    .lp-brand {
        padding: 28px 24px 24px;
        gap: 12px;
    }
    .lp-brand-logo { width: 40px; height: 40px; }
    .lp-brand-name { font-size: 21px; }
    .lp-brand-sub  { display: none; }
    .lp-brand-text { flex-grow: 1; }
    .lp-demo { margin-left: 0; padding: 3px 8px; font-size: 11px; }

    .lp-main { order: 2; flex: 0 0 auto; padding: 32px 24px 0; }   /* no grow: tournament logo stays right under the form */
    .lp-form { gap: 22px; }
    .lp-head h1 { font-size: 28px; margin-bottom: 6px; }
    .lp-head p  { font-size: 14px; }
    .lp-help { display: none; }

    .lp-tour {
        order: 3;
        background: transparent;
        padding: 28px 24px 0;
    }
    .lp-tour-box { width: 160px; height: 160px; }
    .lp-tour-logo { border: 1px solid #E1E5EA; padding: 12px; }
    .lp-tour-placeholder {
        gap: 12px;
        border-color: #E1E5EA;
        background: radial-gradient(circle at 50% 45%, rgba(43, 160, 199, .18) 0%, rgba(43, 160, 199, .04) 55%, #fff 85%);
    }
    .lp-tour-placeholder::after {
        top: 10px; right: 10px; bottom: 10px; left: 10px;
        border-color: #C9DCE4;
    }
    .lp-tour-placeholder img { width: 64px; height: 64px; }
    .lp-tour-placeholder span { font-size: 11px; color: #3D6E80; letter-spacing: 2.4px; }

    .lp-foot { order: 4; margin-top: auto; padding: 20px; font-size: 12px; }
}
