/* ========================================
   NowaCRM - Login Page (ISPRadius-inspired)
   ======================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #f0f0f8 0%, #e8eaf6 50%, #f5f3ff 100%);
}

/* ── Left Panel ── */
.login-left {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

/* Abstract illustration - floating shapes */
.login-illustration {
    position: relative;
    width: 280px;
    height: 280px;
    margin-bottom: 48px;
}

.login-illustration .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}

.login-illustration .shape-1 {
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    top: 20px;
    left: 30px;
    opacity: 0.12;
    animation: floatShape 8s ease-in-out infinite;
}

.login-illustration .shape-2 {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: 60px;
    left: 70px;
    opacity: 0.1;
    animation: floatShape 6s ease-in-out infinite reverse;
}

.login-illustration .shape-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    top: 40px;
    left: 10px;
    opacity: 0.18;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: floatShape 10s ease-in-out infinite;
}

.login-illustration .shape-4 {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    bottom: 30px;
    right: 20px;
    opacity: 0.15;
    border-radius: 50%;
    animation: floatShape 7s ease-in-out infinite reverse;
}

/* Network node icon in center */
.login-illustration .center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.login-illustration .center-icon img {
    width: 48px;
    height: 48px;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.login-left-content {
    text-align: center;
    max-width: 380px;
}

.login-left-content h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-left-content .subtitle {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 32px;
}

.trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.trust-badge i {
    font-size: 18px;
}

.trust-badge .ph-shield-check {
    color: #10b981;
}

.trust-badge .ph-lock-simple {
    color: #3b82f6;
}

/* ── Right Panel ── */
.login-right {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.login-form-wrapper {
    width: 100%;
    max-width: 460px;
    animation: cardEnter 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(16px);
}

@keyframes cardEnter {
    to { opacity: 1; transform: translateY(0); }
}

/* Header - Logo */
.login-header {
    text-align: center;
    margin-bottom: 16px;
}

.login-logo {
    height: 36px;
    margin-bottom: 20px;
    display: inline-block;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-header .subtitle {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 400;
}

/* Form Card */
.login-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.login-card .card-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
    text-align: center;
}

.login-card .card-subtitle {
    font-size: 14px;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    font-size: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    transition: all 0.2s ease;
    color: #1e293b;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

/* Input with icon */
.input-icon-group {
    position: relative;
}

.input-icon-group .form-control {
    padding-right: 46px;
}

.input-icon-group .input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
}

/* Password toggle */
.input-group {
    position: relative;
}

.input-group .form-control {
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 5;
}

.toggle-password:hover {
    color: #6366f1;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

.form-check-label {
    font-size: 13px;
    color: #64748b;
    user-select: none;
}

.forgot-link {
    font-size: 13px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

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

/* Sign In Button */
.btn-login {
    width: 100%;
    height: 46px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.btn-login:active {
    background: #4338ca;
    transform: translateY(0);
}

.btn-login:disabled {
    background: #c7d2fe;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Footer text */
.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

.login-footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

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

/* SSO Link (legacy support) */
.sso-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.sso-link a {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.sso-link a:hover {
    color: #6366f1;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    animation: shake 0.4s ease;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}

/* Validation */
.input-error {
    border-color: #ef4444 !important;
}

.input-error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08) !important;
}

.validation-message {
    font-size: 12px;
    margin-top: 4px;
    color: #ef4444;
    display: block;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .login-left {
        display: none;
    }

    .login-right {
        flex: 1;
    }
}

@media (max-width: 767px) {
    body {
        background: white;
    }

    .login-right {
        padding: 24px 20px;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .login-card {
        box-shadow: none;
        padding: 0;
        background: transparent;
    }

    .form-control {
        height: 50px;
        font-size: 16px; /* prevent iOS zoom */
    }

    .btn-login {
        height: 50px;
        font-size: 16px;
    }

    .form-check-input {
        width: 20px;
        height: 20px;
    }

    .toggle-password {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}
