/* Login Page — Phase 2 Modern UI */

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

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1e293b;
    background: #e8edf5;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Main card container */
div#main {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 860px;
    overflow: hidden;
    filter: none;
    height: auto;
    margin: 0 auto;
    padding: 0;
}

div#main table {
    width: 100%;
    height: auto;
    border-collapse: collapse;
}

div#main table td {
    vertical-align: middle;
}

/* Logo / brand image side */
div#main table td.logo-block {
    width: 45%;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5fce 100%);
    text-align: center;
    padding: 50px 40px;
    border-right: none;
}

div#main .logo-block img {
    width: 240px;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin: 0;
}

/* Login form side */
div#main table td.login-block {
    padding: 50px 44px;
    text-align: left;
    background: #ffffff;
}

/* Heading */
div#main table td.login-block h1 {
    font-family: 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
    padding: 0;
    letter-spacing: -0.5px;
    text-shadow: none;
}

/* Subtitle */
div#main table td.login-block .page-description {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #64748b;
    margin: 0 0 28px 0;
    padding: 0;
    text-align: left;
    line-height: 1.5;
}

/* Form fields */
div#main table td.login-block .field {
    margin-bottom: 16px;
}

div#main table td.login-block .field input[type="text"],
div#main table td.login-block .field input[type="password"],
div#main table td.login-block .field input[type="email"],
div#main table td.login-block .field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: none;
    box-sizing: border-box;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

div#main table td.login-block .field input:focus {
    border-color: #2d5fce;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(45, 95, 206, 0.15);
}

div#main table td.login-block .field input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Submit button */
div#main table td.login-block input[type="submit"],
div#main table td.login-block input[type="submit"][name="login"],
div#main table td.login-block input[type="submit"][name="save"] {
    width: 100%;
    padding: 13px 20px;
    margin: 8px 0 0 0;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2d5fce 0%, #1e4bb8 100%);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(45, 95, 206, 0.3);
    height: auto;
    box-sizing: border-box;
    letter-spacing: 0.3px;
    -webkit-appearance: none;
    appearance: none;
}

div#main table td.login-block input[type="submit"]:hover {
    background: linear-gradient(135deg, #244db0 0%, #1a3f9e 100%);
    box-shadow: 0 6px 16px rgba(45, 95, 206, 0.4);
    transform: translateY(-1px);
}

div#main table td.login-block input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(45, 95, 206, 0.3);
}

/* Forgot password link */
div#main table td.login-block .fp-wrapper {
    text-align: center;
    margin: 18px 0 0 0;
    padding: 0;
    width: 100%;
}

div#main table td.login-block .fp-wrapper a {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #2d5fce;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0;
    transition: color 0.15s;
}

div#main table td.login-block .fp-wrapper a:hover {
    color: #1e4bb8;
    text-decoration: underline;
}

/* Error messages */
.ui-state-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    text-align: left;
    font-size: 13px;
    color: #dc2626;
    line-height: 1.5;
}

.ui-state-error .ui-icon {
    display: none;
}

.ui-state-error strong {
    font-weight: 600;
}

.ui-state-error small {
    font-size: 13px;
}

div#main table td.login-block .errorlist {
    margin: 4px 0 12px 0;
    padding: 0;
    list-style: none;
}

div#main table td.login-block .errorlist li {
    color: #dc2626;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    text-shadow: none;
}

/* Back button (2FA flow) */
div#main table td.login-block input[name="back"] {
    background: transparent !important;
    color: #2d5fce !important;
    box-shadow: none !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transform: none !important;
}

/* Override any jQuery UI button styles */
.ui-button,
.ui-widget,
.ui-corner-all {
    font-family: 'Inter', sans-serif !important;
}

/* Responsive — stack on narrow screens */
@media (max-width: 640px) {
    body {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }

    div#main {
        max-width: 420px;
        border-radius: 14px;
    }

    div#main table,
    div#main table tbody,
    div#main table tr,
    div#main table td {
        display: block;
        width: 100%;
    }

    div#main table td.logo-block {
        border-right: none;
        border-radius: 14px 14px 0 0;
        padding: 36px 24px;
    }

    div#main .logo-block img {
        width: 160px;
    }

    div#main table td.login-block {
        padding: 32px 24px;
        border-radius: 0 0 14px 14px;
    }

    div#main table td.login-block h1 {
        font-size: 22px;
    }
}

/* Server IP at bottom */
.server-ip {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 16px;
    letter-spacing: 0.3px;
}
