:root {
    --ms-primary: #0b5c4a;
    --ms-primary-dark: #084636;
    --ms-accent: #c9a227;
    --ms-text: #1f2937;
    --ms-muted: #6b7280;
    --ms-border: #d1d5db;
    --ms-danger-bg: #fef2f2;
    --ms-danger-text: #991b1b;
    --ms-card: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.ms-login-page {
    margin: 0;
    direction: rtl;
    font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
    color: var(--ms-text);
    background:
        radial-gradient(circle at 15% 20%, rgba(201, 162, 39, 0.18), transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.08), transparent 40%),
        linear-gradient(145deg, #063d32 0%, #0b5c4a 45%, #127a63 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

body.ms-login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 0 0, rgba(201, 162, 39, 0.16) 2px, transparent 2px),
        radial-gradient(circle at 22px 22px, rgba(201, 162, 39, 0.1) 2px, transparent 2px);
    background-size: 44px 44px;
    opacity: 0.22;
    pointer-events: none;
}

.ms-login-shell {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.ms-login-card {
    background: var(--ms-card);
    border-radius: 20px;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    padding: 2rem 1.75rem 1.75rem;
    animation: ms-fade-in 0.45s ease;
}

@keyframes ms-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ms-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ms-brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--ms-primary), #148f73);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 8px 20px rgba(11, 92, 74, 0.35);
}

.ms-brand h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--ms-primary-dark);
    letter-spacing: 0.02em;
}

.ms-field {
    margin-bottom: 1rem;
}

.ms-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
}

.ms-field input {
    width: 100%;
    border: 1px solid var(--ms-border);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    background: #f9fafb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ms-field input:focus {
    outline: none;
    border-color: var(--ms-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 92, 74, 0.14);
}

.ms-submit {
    width: 100%;
    margin-top: 0.35rem;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--ms-primary), #148f73);
    box-shadow: 0 10px 24px rgba(11, 92, 74, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.ms-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(11, 92, 74, 0.42);
}

.ms-submit:active {
    transform: translateY(0);
}

.ms-alert {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: var(--ms-danger-bg);
    color: var(--ms-danger-text);
    font-size: 0.9rem;
    border: 1px solid #fecaca;
}

.ms-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 480px) {
    .ms-login-card {
        padding: 1.5rem 1.25rem 1.25rem;
        border-radius: 16px;
    }

    .ms-brand h1 {
        font-size: 1.45rem;
    }
}
