/* Phase 8.1 - Globly CRM Login Page Styles */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #F8F9FA;
    overflow-x: hidden;
}

/* Background image layer (only if set) */
.login-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

/* Overlay tint to ensure form readability */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(27, 67, 50, var(--overlay-opacity, 0.4));
    z-index: -1;
}

/* No background fallback - solid sage green page */
body.no-bg {
    background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
}

/* Card */
.login-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    margin: 20px;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-img {
    max-width: 160px;
    max-height: 80px;
    margin: 0 auto 12px;
    display: block;
    object-fit: contain;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #1B4332;
    margin: 0;
}

.login-subtitle {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
}

/* Form */
.login-form .form-group { margin-bottom: 20px; }

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #E0E0E0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #F8F9FA;
    transition: border-color 0.2s, background 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--button-color, #1B4332);
    background: white;
}

.password-row {
    display: flex;
    gap: 8px;
}

.password-row input { flex: 1; }

.password-toggle {
    background: white;
    border: 1.5px solid #E0E0E0;
    border-radius: 10px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 16px;
    transition: border-color 0.2s;
}

.password-toggle:hover { border-color: var(--button-color, #1B4332); }

.login-button {
    width: 100%;
    padding: 14px 16px;
    background: var(--button-color, #1B4332);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 8px;
}

.login-button:hover { opacity: 0.92; }
.login-button:active { transform: scale(0.99); }

.login-error {
    background: #FEE2E2;
    border-left: 4px solid #DC2626;
    color: #991B1B;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

.login-link-row {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #888;
}

.login-link-row a {
    color: var(--link-color, #C9A84C);
    text-decoration: none;
    font-weight: 600;
}

.login-link-row a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .login-card { padding: 32px 24px; }
    .login-title { font-size: 22px; }
}
