/* ============================================================
   JobScout Frontend Login — jsl.css
   ============================================================ */

/* ---------- Nav icon ---------- */
.jsl-nav-item {
    display: flex;
    align-items: center;
    list-style: none;
}

.jsl-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    font-size: 14px;
    padding-left: 15px;
    border-radius: 4px;
    transition: opacity .2s;
    line-height: 1;
}

.jsl-nav-btn:hover { opacity: .75; }

.jsl-nav-btn svg { flex-shrink: 0; }

.jsl-nav-name {
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Overlay ---------- */
.jsl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: jslFadeIn .18s ease;
}

.jsl-overlay[hidden] { display: none !important; }

@keyframes jslFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Modal ---------- */
.jsl-modal {
    background: #fff;
    border-radius: 10px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    animation: jslSlideUp .2s ease;
}

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

/* ---------- Close ---------- */
.jsl-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 2px 6px;
}
.jsl-close:hover { color: #333; }

/* ---------- Tabs ---------- */
.jsl-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.jsl-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #999;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}

.jsl-tab-active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

/* ---------- Message ---------- */
.jsl-msg {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.jsl-msg[hidden] { display: none !important; }

.jsl-msg.jsl-ok  { background: #e8f5e9; color: #2e7d32; }
.jsl-msg.jsl-err { background: #fdecea; color: #c62828; }

/* ---------- Panels ---------- */
.jsl-panel { }
.jsl-hidden { display: none !important; }

/* ---------- Fields ---------- */
.jsl-field {
    margin-bottom: 14px;
}

.jsl-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}

.jsl-field input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #222;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color .15s;
    outline: none;
}

.jsl-field input:focus {
    border-color: #1a73e8;
    background: #fff;
}

/* ---------- Buttons ---------- */
.jsl-btn {
    display: block;
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: background .15s, opacity .15s;
}

.jsl-btn-primary {
    background: #1a73e8;
    color: #fff;
}

.jsl-btn-primary:hover { background: #1558b0; }

.jsl-btn-primary:disabled {
    opacity: .6;
    cursor: default;
}

.jsl-btn-logout {
    background: #f44336;
    color: #fff;
    margin-top: 14px;
}

.jsl-btn-logout:hover { background: #c62828; }

/* ---------- Forgot / back links ---------- */
.jsl-forgot {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}

.jsl-forgot a {
    color: #1a73e8;
    text-decoration: none;
}

.jsl-forgot a:hover { text-decoration: underline; }

/* ---------- Reset info ---------- */
.jsl-reset-info {
    font-size: 13px;
    color: #555;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ---------- Logged-in card ---------- */
.jsl-logged-in {
    text-align: center;
    padding-top: 8px;
}

.jsl-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    line-height: 56px;
    margin: 0 auto 12px;
}

.jsl-welcome {
    font-size: 16px;
    margin: 0 0 4px;
}

.jsl-email {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* ---------- Scroll lock (iOS / PWA safe) ----------
   overflow:hidden alone breaks position:sticky headers on iOS PWA.
   We use position:fixed + saved scroll offset instead.
   The top value is set inline by JS (openModal / closeModal).
-------------------------------------------------------- */
body.jsl-modal-open {
    position: fixed;
    left: 0;
    right: 0;
    overflow-y: scroll; /* keep scrollbar width so layout doesn't shift */
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .jsl-modal { padding: 24px 18px 20px; }
}
