/* CMS login page - "living blueprint": the CMS logo is drawn like an engineering sheet. */
:root {
    --bp-bg: #0a2744;
    --bp-line: #7fb6f2;
    --bp-text: #9cc6f5;
    --bp-blue: #1f5fa8;
    --bp-red: #e0393e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: 'Tajawal', Tahoma, sans-serif;
    background: var(--bp-bg);
    overflow: hidden;
}

.bp { position: fixed; inset: 0; overflow: hidden; }

.bp-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(120, 170, 230, .10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 170, 230, .10) 1px, transparent 1px),
        linear-gradient(rgba(120, 170, 230, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 170, 230, .05) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}

/* Drawing */
.bp-drawing { position: absolute; inset: 0; width: 100%; height: 100%; direction: ltr; }
.bp-drawing text { direction: ltr; unicode-bidi: isolate; }

.bp-letters text {
    font-family: 'Arial Black', 'Tajawal', sans-serif;
    font-weight: 900;
    font-size: 430px;
    stroke-width: 3;
    fill-opacity: 0;
    stroke-dasharray: 2600;
    stroke-dashoffset: 2600;
    animation: bp-draw 4s ease forwards, bp-fill 1.6s 3.6s ease forwards;
}
.bp-c { stroke: #c9d6e6; fill: rgba(201, 214, 230, .16); }
.bp-ms { stroke: var(--bp-line); fill: rgba(58, 139, 224, .28); }

.bp-dims path, .bp-dims circle {
    fill: none;
    stroke: var(--bp-line);
    stroke-width: 1.2;
    opacity: 0;
    animation: bp-fade 1s 2.4s forwards;
}

.bp-notes text {
    fill: var(--bp-text);
    font: 500 16px 'Tajawal', sans-serif;
    letter-spacing: 1px;
    direction: ltr;
    opacity: 0;
    animation: bp-fade 1s 2.8s forwards;
}

@keyframes bp-draw { to { stroke-dashoffset: 0; } }
@keyframes bp-fill { to { fill-opacity: 1; } }
@keyframes bp-fade { to { opacity: 1; } }

/* Title-block stamp */
.bp-stamp {
    position: absolute;
    bottom: 24px;
    left: 24px;
    border: 1.5px solid #6fa6e6;
    color: var(--bp-text);
    font-size: 12px;
    line-height: 1.9;
    padding: 8px 14px;
    direction: ltr;
    text-align: left;
}
.bp-stamp b { color: #fff; font-size: 13px; }

/* Mouse crosshair */
.bp-cross-v, .bp-cross-h, .bp-coord {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
}
.bp-cross-v { width: 1px; height: 100%; background: rgba(224, 57, 62, .6); }
.bp-cross-h { height: 1px; width: 100%; background: rgba(224, 57, 62, .6); }
.bp-coord { color: #ff8a8d; font-size: 11px; direction: ltr; white-space: nowrap; }
.bp-moving .bp-cross-v, .bp-moving .bp-cross-h, .bp-moving .bp-coord { opacity: 1; }

/* Login card */
.bp-card {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 9%;
    transform: translateY(-50%);
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 34px 30px 28px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 30px 80px rgba(3, 20, 40, .35);
    text-align: center;
    animation: bp-rise .8s .2s ease both;
}
@keyframes bp-rise { from { opacity: 0; transform: translateY(-46%); } }

.bp-logo { width: 160px; }
.bp-card h1 { font-size: 18px; font-weight: 800; color: #22303f; margin-top: 10px; }
.bp-sub { font-size: 13px; color: #7a8594; margin: 6px 0 22px; }

.bp-error {
    background: #fdecec;
    color: #a32d2d;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: right;
}

.bp-field {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    border: 1.5px solid #dfe3e8;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.bp-field:focus-within { border-color: var(--bp-blue); box-shadow: 0 0 0 4px rgba(31, 95, 168, .12); }
.bp-field > i { font-size: 20px; color: #8a95a3; padding: 0 14px 0 6px; }
.bp-field input {
    flex: 1;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: #22303f;
    min-width: 0;
}
.bp-eye { border: 0; background: none; cursor: pointer; color: #8a95a3; font-size: 20px; padding: 0 12px; }

.bp-submit {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    margin-top: 4px;
    background: var(--bp-blue);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background .2s;
}
.bp-submit:hover { background: #18508f; }
.bp-submit::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--bp-red);
    transform: scaleX(0);
    transition: transform .3s;
}
.bp-submit:hover::after { transform: scaleX(1); }

/* Medium screens: card hugs the edge so it doesn't cover the letters */
@media (max-width: 1400px) {
    .bp-card { left: 3%; }
}

/* Small screens: card centered, drawing fades behind it */
@media (max-width: 900px) {
    .bp-card { left: 50%; transform: translate(-50%, -50%); animation: none; }
    .bp-drawing { opacity: .45; }
    .bp-stamp, .bp-cross-v, .bp-cross-h, .bp-coord { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bp-letters text { animation: none; stroke-dashoffset: 0; fill-opacity: 1; }
    .bp-dims path, .bp-dims circle, .bp-notes text { animation: none; opacity: 1; }
    .bp-card { animation: none; }
}
