@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ─── DESIGN TOKENS ─────────────────────────────────────── */
:root {
    --alm-navy:       #2D4E78;
    --alm-navy-deep:  #1B3154;
    --alm-navy-light: #3D6494;
    --alm-azure:      #3FA9F5;
    --alm-azure-glow: rgba(63, 169, 245, .35);
    --alm-coral:      #E26A4B;
    --alm-white:      #FFFFFF;
    --alm-off-white:  #F7F9FC;
    --alm-slate:      #8499B0;
    --alm-border:     #E2EAF4;
}

/* ─── ROOT LAYOUT ───────────────────────────────────────── */
.alm-login-root {
    display: flex;
    min-height: 100vh;
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--alm-off-white);
    overflow: hidden;
}

/* ─── LEFT BRAND PANEL ──────────────────────────────────── */
.alm-brand {
    position: relative;
    flex: 0 0 52%;
    background: var(--alm-navy-deep);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 72px 64px;
    overflow: hidden;
    animation: alm-panelSlideIn .9s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes alm-panelSlideIn {
    from { transform: translateX(-40px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* Gradient mesh background */
.alm-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(63, 169, 245, .18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(226, 106, 75, .12) 0%, transparent 55%),
        radial-gradient(ellipse 100% 80% at 50% 50%, rgba(29, 49, 84, .9) 0%, transparent 100%);
    z-index: 0;
}

/* Noise texture overlay */
.alm-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    z-index: 0;
    opacity: .6;
}

.alm-brand > * { position: relative; z-index: 1; }

/* ─── DECORATIVE FLOATING SVGs ──────────────────────────── */
.alm-deco {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.alm-deco-tl {
    top: -60px;
    right: -40px;
    width: 340px;
    height: 340px;
    opacity: .07;
    animation: alm-floatA 8s ease-in-out infinite;
}

.alm-deco-br {
    bottom: -80px;
    left: -60px;
    width: 420px;
    height: 420px;
    opacity: .06;
    animation: alm-floatB 10s ease-in-out infinite;
}

@keyframes alm-floatA {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-20px) rotate(5deg); }
}

@keyframes alm-floatB {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(16px) rotate(-4deg); }
}

/* ─── BRAND LOGO ────────────────────────────────────────── */
.alm-brand-logo {
    margin-bottom: 56px;
    animation: alm-fadeUp .7s .3s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-brand-logo img {
    height: 48px;
    width: auto;
}

/* ─── BRAND DIVIDER ─────────────────────────────────────── */
.alm-brand-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--alm-azure), var(--alm-coral));
    border-radius: 2px;
    margin-bottom: 32px;
    animation: alm-fadeUp .7s .42s cubic-bezier(.22, 1, .36, 1) both;
}

/* ─── BRAND HEADLINE ────────────────────────────────────── */
.alm-brand-headline {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.2rem, 3.5vw, 3.4rem);
    font-weight: 700;
    color: var(--alm-white);
    line-height: 1.15;
    letter-spacing: -.02em;
    margin-bottom: 20px;
    animation: alm-fadeUp .7s .45s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-brand-headline em {
    font-style: normal;
    color: var(--alm-azure);
}

.alm-brand-sub {
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(255, 255, 255, .6);
    line-height: 1.65;
    max-width: 380px;
    margin-bottom: 56px;
    animation: alm-fadeUp .7s .55s cubic-bezier(.22, 1, .36, 1) both;
}

/* ─── FEATURE LIST ──────────────────────────────────────── */
.alm-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: alm-fadeUp .7s .65s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.alm-feature-dot {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(63, 169, 245, .15);
    border: 1px solid rgba(63, 169, 245, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alm-feature-dot svg {
    width: 18px;
    height: 18px;
    fill: var(--alm-azure);
}

.alm-feature-label {
    font-size: .9rem;
    color: rgba(255, 255, 255, .75);
    font-weight: 400;
}

/* ─── RIGHT FORM PANEL ──────────────────────────────────── */
.alm-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    background: var(--alm-white);
    position: relative;
    animation: alm-formSlideIn .9s .1s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes alm-formSlideIn {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* Corner accent glows */
.alm-form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 240px;
    background: radial-gradient(ellipse at top right, rgba(63, 169, 245, .08), transparent 65%);
    pointer-events: none;
}

.alm-form-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 180px;
    height: 180px;
    background: radial-gradient(ellipse at bottom left, rgba(226, 106, 75, .06), transparent 65%);
    pointer-events: none;
}

.alm-form-inner {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.alm-form-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    animation: alm-fadeUp .6s .45s cubic-bezier(.22, 1, .36, 1) both;
}

.el-lang {
    display: flex;
    background: var(--mud-palette-action-default-hover);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.el-lang-btn {
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    transition: all 0.15s ease;
    line-height: 1;
}

.el-lang-btn:hover {
    color: var(--mud-palette-text-primary);
}

.el-lang-btn:focus-visible {
    outline: 2px solid var(--alm-azure);
    outline-offset: 2px;
}

.el-lang-btn--on {
    background: var(--mud-palette-surface);
    color: #1A90B0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

/* ─── MOBILE LOGO ───────────────────────────────────────── */
.alm-mobile-logo {
    display: none;
    margin-bottom: 36px;
    text-align: center;
}

.alm-mobile-logo img { height: 44px; }

/* ─── FORM HEADER ───────────────────────────────────────── */
.alm-form-header {
    margin-bottom: 40px;
}

.alm-form-eyebrow {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--alm-azure);
    margin-bottom: 10px;
    animation: alm-fadeUp .6s .5s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-form-title {
    font-family: 'Syne', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--alm-navy-deep);
    letter-spacing: -.025em;
    line-height: 1.2;
    margin-bottom: 8px;
    animation: alm-fadeUp .6s .55s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-form-desc {
    font-size: .9rem;
    color: var(--alm-slate);
    font-weight: 400;
    animation: alm-fadeUp .6s .6s cubic-bezier(.22, 1, .36, 1) both;
}

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

/* ─── FORM FIELDS ───────────────────────────────────────── */
.alm-field {
    margin-bottom: 20px;
    animation: alm-fadeUp .6s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-field:nth-child(1) { animation-delay: .65s; }
.alm-field:nth-child(2) { animation-delay: .72s; }

.alm-field-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--alm-navy);
    margin-bottom: 8px;
    letter-spacing: .03em;
}

.alm-input-wrap {
    position: relative;
}

.alm-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--alm-slate);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color .2s;
}

.alm-input-icon svg {
    width: 18px;
    height: 18px;
}

.alm-input {
    width: 100%;
    height: 50px;
    padding: 0 44px;
    border: 1.5px solid var(--alm-border);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: .92rem;
    color: var(--alm-navy-deep);
    background: var(--alm-off-white);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
}

.alm-input::placeholder { color: #B0BECE; }

.alm-input:focus {
    border-color: var(--alm-azure);
    background: var(--alm-white);
    box-shadow: 0 0 0 4px var(--alm-azure-glow);
}

.alm-input-wrap:focus-within .alm-input-icon {
    color: var(--alm-azure);
}

/* ─── PASSWORD TOGGLE ───────────────────────────────────── */
.alm-toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--alm-slate);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    transition: color .2s;
}

.alm-toggle-pw:hover { color: var(--alm-navy); }

.alm-toggle-pw svg {
    width: 18px;
    height: 18px;
}

/* ─── REMEMBER ME + FORGOT ROW ──────────────────────────── */
.alm-row-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    animation: alm-fadeUp .6s .78s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.alm-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: var(--alm-azure);
    cursor: pointer;
}

.alm-remember span {
    font-size: .85rem;
    color: var(--alm-slate);
}

.alm-forgot {
    font-size: .85rem;
    color: var(--alm-azure);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}

.alm-forgot:hover { color: var(--alm-navy); }

/* ─── SUBMIT BUTTON ─────────────────────────────────────── */
.alm-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--alm-navy) 0%, var(--alm-navy-light) 100%);
    color: var(--alm-white);
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .15s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: alm-fadeUp .6s .84s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--alm-azure) 0%, var(--alm-navy) 100%);
    opacity: 0;
    transition: opacity .3s;
}

.alm-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(45, 78, 120, .4);
}

.alm-btn:hover:not(:disabled)::before { opacity: .25; }

.alm-btn:active:not(:disabled) { transform: translateY(0); }

.alm-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.alm-btn span { position: relative; z-index: 1; }

/* ─── LOADING SPINNER ───────────────────────────────────── */
.alm-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .3);
    border-top-color: white;
    border-radius: 50%;
    animation: alm-spin .7s linear infinite;
    position: relative;
    z-index: 1;
}

@keyframes alm-spin { to { transform: rotate(360deg); } }

/* ─── ERROR MESSAGE ─────────────────────────────────────── */
.alm-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(226, 106, 75, .08);
    border: 1px solid rgba(226, 106, 75, .3);
    border-radius: 10px;
    margin-top: 20px;
    animation: alm-fadeUp .3s ease both;
}

.alm-error-icon {
    color: var(--alm-coral);
    flex-shrink: 0;
    margin-top: 1px;
}

.alm-error-icon svg { width: 16px; height: 16px; }

.alm-error-text {
    font-size: .85rem;
    color: #c0472e;
    line-height: 1.5;
}

/* ─── FOOTER LINKS ──────────────────────────────────────── */
.alm-form-footer {
    margin-top: 32px;
    text-align: center;
    animation: alm-fadeUp .6s .9s cubic-bezier(.22, 1, .36, 1) both;
}

.alm-form-footer p {
    font-size: .83rem;
    color: var(--alm-slate);
    margin-bottom: 6px;
}

.alm-form-footer a {
    color: var(--alm-azure);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}

.alm-form-footer a:hover { color: var(--alm-navy); }

/* ─── MUDBLAZOR OVERRIDES ───────────────────────────────── */
.alm-login-root .mud-container { padding: 0; max-width: 100%; }
.alm-login-root .mud-paper    { box-shadow: none; background: transparent; padding: 0; }

html[dir="rtl"] .alm-login-root {
    direction: rtl;
}

html[dir="rtl"] .alm-brand {
    align-items: flex-end;
    text-align: right;
}

html[dir="rtl"] .alm-form-inner,
html[dir="rtl"] .alm-form-header,
html[dir="rtl"] .alm-field-label {
    text-align: right;
}

html[dir="rtl"] .alm-form-toolbar {
    justify-content: flex-start;
}

html[dir="rtl"] .alm-feature-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .alm-input-icon {
    left: auto;
    right: 14px;
}

html[dir="rtl"] .alm-toggle-pw {
    right: auto;
    left: 14px;
}

html[dir="rtl"] .alm-input {
    text-align: right;
}

html[dir="rtl"] .alm-row-meta {
    flex-direction: row-reverse;
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
    .alm-brand         { display: none; }
    .alm-form-panel    { padding: 48px 32px; }
    .alm-mobile-logo   { display: block; }
}

@media (max-width: 480px) {
    .alm-form-panel  { padding: 40px 20px; }
    .alm-form-title  { font-size: 1.8rem; }
}
