* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--brand-text);
    background: var(--brand-panel-tint);
    -webkit-font-smoothing: antialiased;
}

.modern-shell {
    display: flex;
    min-height: 100vh;
}

.modern-brand {
    flex: 0 0 45%;
    background: linear-gradient(160deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.modern-brand::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 320px;
    height: 320px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.modern-brand::after {
    content: '';
    position: absolute;
    bottom: -160px;
    left: -160px;
    width: 380px;
    height: 380px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.modern-brand-logo {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-width: 420px;
    width: 100%;
}

.modern-brand-logo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
}

.modern-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: linear-gradient(180deg, var(--brand-panel-tint) 0%, var(--brand-panel-tint-deep) 100%);
}

.modern-form-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(10, 23, 72, 0.12);
}

.modern-form-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--brand-text);
}

.modern-form-subtitle {
    font-size: 15px;
    color: var(--brand-muted);
    margin: 0 0 32px;
}

.modern-field {
    margin-bottom: 18px;
}

.modern-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-text);
    margin-bottom: 6px;
}

.modern-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--brand-text);
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.modern-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(10, 23, 72, 0.15);
}

.modern-error {
    display: block;
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
}

.modern-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 24px;
}

.modern-remember {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: var(--brand-text);
    cursor: pointer;
    user-select: none;
}

.modern-remember input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
}

.modern-link {
    font-size: 14px;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.modern-link:hover {
    text-decoration: underline;
}

.modern-submit {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: var(--brand-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.05s;
}

.modern-submit:hover {
    background: var(--brand-primary-dark);
}

.modern-submit:active {
    transform: translateY(1px);
}

.modern-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--brand-text);
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.modern-secondary:hover {
    background: #f6f7fb;
    border-color: var(--brand-primary);
    color: var(--brand-text);
    text-decoration: none;
}

.modern-secondary .ms-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2023%2023%22%3E%3Cpath%20fill%3D%22%23f3f3f3%22%20d%3D%22M0%200h23v23H0z%22%2F%3E%3Cpath%20fill%3D%22%23f35325%22%20d%3D%22M1%201h10v10H1z%22%2F%3E%3Cpath%20fill%3D%22%2381bc06%22%20d%3D%22M12%201h10v10H12z%22%2F%3E%3Cpath%20fill%3D%22%2305a6f0%22%20d%3D%22M1%2012h10v10H1z%22%2F%3E%3Cpath%20fill%3D%22%23ffba08%22%20d%3D%22M12%2012h10v10H12z%22%2F%3E%3C%2Fsvg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.modern-portal-links {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.modern-portal-links a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.modern-portal-links a:hover {
    text-decoration: underline;
}

.modern-ms-error {
    display: block;
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
}

.modern-captcha {
    margin: 12px 0 20px;
}

.modern-captcha .g-recaptcha {
    display: flex;
    justify-content: center;
}

@media (max-width: 900px) {
    .modern-shell {
        flex-direction: column;
    }

    .modern-brand {
        flex: 0 0 auto;
        padding: 36px 24px;
        min-height: 220px;
    }

    .modern-brand-logo {
        padding: 24px 32px;
        max-width: 280px;
    }

    .modern-brand-logo img {
        max-height: 140px;
    }

    .modern-form-panel {
        padding: 32px 20px;
    }

    .modern-form-title {
        font-size: 24px;
    }
}
