/*
 * Utilifarm sign-in page (App/Views/Accounts/login.html): the two panels and
 * the form card. Moved out of the page's inline <style> (UI/UX plan, Phase 1,
 * 2026-10-29) and put on the site's palette (css/public.css).
 */
/* The page's own names for the site's palette (css/public.css), on its wrapper only. */
.login-container {
    --accent: var(--warm);
    --accent-light: #f0bb5d;
    --text-dark: var(--ink);
    --text-light: #ffffff;
    --error-color: #c62828;
    --success-color: #2e7d32;
    display: flex;
    min-height: calc(100vh - var(--nav-h));
    background: var(--cream);
    color: var(--text-dark);
}

.login-left {
    flex: 1;
    background: linear-gradient(160deg, var(--primary-deeper) 0%, var(--primary-dark) 60%, var(--primary) 100%);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: cover;
}

.login-left-content {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.login-left h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.login-left p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.features-list {
    list-style: none;
    margin-top: 30px;
}

.features-list li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
}

.features-list li i {
    color: var(--accent);
    margin-right: 10px;
    font-size: 1.2rem;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.card-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.card-header .logo i {
    font-size: 2.5rem;
    margin-right: 10px;
    color: var(--accent);
}

.card-header h1 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.8rem;
}

.card-header p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.card-content {
    padding: 30px;
}

.tenant-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tenant-info i {
    color: var(--primary);
    margin-right: 10px;
}

.tenant-info span {
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-field {
    margin-bottom: 25px;
}

.input-field label {
    color: #666;
    font-weight: 400;
}

.input-field input:focus + label {
    color: var(--primary) !important;
}

.input-field input:focus {
    border-bottom: 1px solid var(--primary) !important;
    box-shadow: 0 1px 0 0 var(--primary) !important;
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 10px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me label {
    color: #666;
    font-size: 0.9rem;
}

.forgot-password {
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: underline;
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.btn.btn-login {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--text-dark);
    width: 100%;
    border-radius: 30px;
    height: 48px;
    font-weight: 500;
    font-size: 1rem;
    text-transform: none;
    box-shadow: 0 4px 6px rgba(255, 160, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-login:hover:not(:disabled) {
    box-shadow: 0 6px 8px rgba(255, 160, 0, 0.3);
    transform: translateY(-2px);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-login.loading {
    position: relative;
}

.btn-login.loading .btn-text {
    opacity: 0;
}

.btn-login .spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn-login.loading .spinner {
    display: block;
}

.alert-box {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

.alert-box i {
    margin-right: 10px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.alert-error {
    background-color: #ffebee;
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.alert-success {
    background-color: #e8f5e9;
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background-color: #fff3e0;
    color: #f57c00;
    border-left: 4px solid #f57c00;
}

.rate-limit-warning {
    background-color: #fff3e0;
    color: #f57c00;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    text-align: center;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.95rem;
}

.register-link a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

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



@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-left {
        padding: 30px 20px;
    }
    
    .login-right {
        padding: 30px 20px;
    }
}

@media (max-width: 600px) {
    .login-card {
        max-width: 100%;
    }
    
    .card-header, .card-content {
        padding: 20px;
    }
    
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* The password's label sits inside .password-container (beside the show/hide button), where Materialize's
   ".input-field > label" does not reach it: placed here the same way, so it floats over the field, not under it. */
.input-field .password-container > label {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1rem;
    cursor: text;
    transform-origin: 0% 100%;
    transform: translateY(12px);
    transition: transform 0.2s ease-out, color 0.2s ease-out;
}
.input-field .password-container > label.active { transform: translateY(-14px) scale(0.8); }
