/* ============================================================
   CONSENTA INSOURCING — Login Page Brand CSS
   Used by both Backend (Admin) & Frontend (Client) login pages
   ============================================================ */

:root {
    --ci-purple       : #500b76;
    --ci-purple-dark  : #3a0855;
    --ci-turquoise    : #16e3c0;
    --ci-green        : #b1fa53;
    --ci-white        : #ffffff;
    --ci-grey-light   : #f5f5f8;
    --ci-grey-border  : #e0e0e8;
    --ci-text-muted   : #888899;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', 'Lexend', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Background Variants ─── */
body.login-backend {
    background: linear-gradient(135deg, #1a0526 0%, #2e0a4a 50%, #500b76 100%);
}

body.login-frontend {
    background: linear-gradient(135deg, #e8f8f5 0%, #f0f4ff 60%, #f5fff0 100%);
}

/* ── Card ─────────────────────────────────────────────────── */
.login-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: var(--ci-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────── */
.login-header {
    padding: 32px 30px 28px;
    text-align: center;
    color: var(--ci-white);
}

/* Backend header */
body.login-backend .login-header {
    background: linear-gradient(135deg, var(--ci-purple-dark), var(--ci-purple));
}

/* Frontend header */
body.login-frontend .login-header {
    background: linear-gradient(135deg, var(--ci-purple), #7b2fbe);
}

.login-header .logo-wrap {
    margin-bottom: 18px;
}

.login-header .logo-wrap img {
    height: 52px;
    width: auto;
    /* Logo has black bg - invert to show on dark header */
    filter: brightness(0) invert(1);
}

/* Fallback icon if logo not loaded */
.login-header .logo-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 14px;
}

.login-header h4 {
    font-family: 'Lexend', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.login-header p {
    font-size: 0.82rem;
    opacity: 0.8;
    margin: 0;
}

/* ── Role Badge on Header ─────────────────────────────────── */
.login-role-badge {
    display: inline-block;
    background: rgba(22, 227, 192, 0.25);
    color: var(--ci-turquoise);
    border: 1px solid var(--ci-turquoise);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 12px;
    margin-top: 8px;
}

/* ── Body ─────────────────────────────────────────────────── */
.login-body {
    padding: 30px 32px 24px;
}

/* ── Form Controls ────────────────────────────────────────── */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
    display: block;
}

.form-control {
    border-radius: 0 8px 8px 0;
    border: 1.5px solid var(--ci-grey-border);
    padding: 10px 14px;
    font-size: 0.88rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    border-left: none;
    width: 100%;
}

.form-control:focus {
    border-color: var(--ci-purple) !important;
    box-shadow: 0 0 0 3px rgba(80, 11, 118, 0.12) !important;
    outline: none;
}

.input-group {
    display: flex;
    align-items: stretch;
    margin-bottom: 2px;
}

.input-group-text {
    background: #f5f5f5;
    border: 1.5px solid var(--ci-grey-border);
    border-radius: 8px 0 0 8px;
    border-right: none;
    color: var(--ci-purple);
    padding: 0 12px;
    display: flex;
    align-items: center;
    font-size: 1rem;
}

/* ── Submit Button ────────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    color: var(--ci-white);
    margin-top: 6px;
}

body.login-backend .btn-login {
    background: linear-gradient(135deg, var(--ci-purple-dark), var(--ci-purple));
}

body.login-frontend .btn-login {
    background: linear-gradient(135deg, var(--ci-purple), #7b2fbe);
}

.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(80, 11, 118, 0.35);
}

/* ── Remember Me ──────────────────────────────────────────── */
.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0 16px;
}

.form-check-label {
    font-size: 0.82rem;
    color: #666;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--ci-purple) !important;
    border-color: var(--ci-purple) !important;
}

/* ── Forgot Link ──────────────────────────────────────────── */
.forgot-link {
    font-size: 0.82rem;
    color: var(--ci-purple);
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--ci-purple-dark);
    text-decoration: underline;
}

/* ── Error Messages ───────────────────────────────────────── */
.help-block, .invalid-feedback {
    font-size: 0.78rem;
    color: #dc3545;
    margin-top: 4px;
}

.has-error .input-group-text,
.has-error .form-control {
    border-color: #dc3545 !important;
}

/* ── Footer ───────────────────────────────────────────────── */
.login-footer {
    background: var(--ci-grey-light);
    padding: 13px 30px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--ci-text-muted);
    border-top: 1px solid var(--ci-grey-border);
}

.login-footer a {
    color: var(--ci-purple);
    text-decoration: none;
}

/* ── Turquoise Accent Strip ───────────────────────────────── */
.login-card::after {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--ci-purple), var(--ci-turquoise), var(--ci-green));
    position: relative;
}
