/* KiviCare Login Widget - Matching Registration Design */

#kc-login-widget {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.kc-login-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Main Container */
.kc-login-container {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 30px;
    align-items: start;
}

/* Left Sidebar */
.kc-login-sidebar {
    background: linear-gradient(180deg, #49274A 0%, #49274Aaa 100%);
    border-radius: 16px;
    padding: 60px 30px;
    color: #fff;
    position: sticky;
    top: 20px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.kc-login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.kc-login-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
}

.kc-login-header h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.kc-login-header p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Right Content Area */
.kc-login-content {
    background: #fff;
    border-radius: 16px;
    padding: 50px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Section Title */
.kc-section-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 30px 0;
}

/* Form Groups */
.kc-form-group {
    margin-bottom: 24px;
    position: relative;
}

.kc-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
    color: #2D3748;
    box-sizing: border-box;
}

.kc-input:focus {
    outline: none;
    border-color: #49274A;
    box-shadow: 0 0 0 3px rgba(73, 39, 74, 0.1);
}

.kc-input::placeholder {
    color: transparent;
}

.kc-form-group label:not(.kc-checkbox-label) {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 15px;
    font-weight: 500;
    color: #718096;
    transition: all 0.3s ease;
    pointer-events: none;
    background: #fff;
    padding: 0 4px;
}

.kc-form-group label:not(.kc-checkbox-label) .required {
    color: #e53e3e;
    margin-left: 2px;
}

/* Floating label on focus or when input has value */
.kc-input:focus + label:not(.kc-checkbox-label),
.kc-input:not(:placeholder-shown) + label:not(.kc-checkbox-label),
.kc-input.has-value + label:not(.kc-checkbox-label) {
    top: -10px;
    left: 12px;
    font-size: 12px;
    color: #49274A;
    font-weight: 600;
}

.required {
    color: #e53e3e;
}

/* Password Group with Toggle Button */
.kc-password-group {
    margin-bottom: 24px;
    position: relative;
}

.kc-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.kc-password-input {
    width: 100%;
    padding: 16px;
    padding-right: 44px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
    color: #2D3748;
    box-sizing: border-box;
}

.kc-password-input:focus {
    outline: none;
    border-color: #49274A;
    box-shadow: 0 0 0 3px rgba(73, 39, 74, 0.1);
}

.kc-password-input::placeholder {
    color: transparent;
}

.kc-password-wrapper > label:not(.kc-checkbox-label) {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 15px;
    font-weight: 500;
    color: #718096;
    transition: all 0.3s ease;
    pointer-events: none;
    background: #fff;
    padding: 0 4px;
    z-index: 1;
}

.kc-password-wrapper > label:not(.kc-checkbox-label) .required {
    color: #e53e3e;
    margin-left: 2px;
}

/* Floating label on focus or when input has value */
.kc-password-input:focus + label:not(.kc-checkbox-label),
.kc-password-input:not(:placeholder-shown) + label:not(.kc-checkbox-label) {
    top: -10px;
    left: 12px;
    font-size: 12px;
    color: #49274A;
    font-weight: 600;
}

.kc-password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    font-size: 16px;
    padding: 8px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.kc-password-toggle:hover {
    color: #49274A;
    transform: scale(1.1);
}

.kc-password-toggle:focus {
    outline: none;
}

/* Form Options - Remember & Forgot Password */
.kc-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 15px;
}

.kc-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.kc-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #49274A;
    flex-shrink: 0;
}

.kc-checkbox-group label {
    margin: 0;
    font-size: 14px;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.3s ease;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    top: auto !important;
    left: auto !important;
}

.kc-checkbox-group label:hover {
    color: #49274A;
}

/* Forgot Password Link */
.kc-forgot-link {
    color: #49274A;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.kc-forgot-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.kc-forgot-link:focus {
    outline: 2px solid #49274A;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Login Button */
.kc-login-btn {
    width: 100%;
    padding: 12px 24px;
    background: #49274A;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.kc-login-btn:hover {
    background: rgba(73, 39, 74, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(73, 39, 74, 0.2);
}

.kc-login-btn:active {
    transform: translateY(0);
}

.kc-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Login Footer */
.kc-login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.kc-divider {
    width: 100%;
    height: 1px;
    background: #e0e0e0;
    margin: 0 0 20px 0;
}

.kc-forgot-password-footer-link {
    color: #49274A;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.kc-forgot-password-footer-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.kc-forgot-password-footer-link:focus {
    outline: 2px solid #49274A;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Alert Messages */
.kc-alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.kc-alert-error {
    background: #fed7d7;
    color: #c53030;
    border-left: 4px solid #c53030;
}

.kc-alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #22543d;
}

/* Loading Indicator */
.kc-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 300px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #49274A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.kc-loading-indicator p {
    color: #4a5568;
    font-size: 14px;
    margin: 0;
}

/* Restricted Widget */
.kc-widget-restricted {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.kc-restriction-message {
    background: #fed7d7;
    color: #c53030;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #c53030;
}

.kc-restriction-message i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.kc-restriction-message h3 {
    font-size: 20px;
    margin: 0 0 10px 0;
}

.kc-restriction-message p {
    font-size: 14px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kc-login-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .kc-login-sidebar {
        position: relative;
        top: 0;
        min-height: auto;
        padding: 40px 30px;
    }

    .kc-login-content {
        padding: 30px;
        min-height: auto;
    }

    .kc-section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .kc-form-group {
        margin-bottom: 20px;
    }

    .kc-form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .kc-forgot-link {
        align-self: flex-end;
    }

    .kc-login-header h2 {
        font-size: 24px;
    }

    .kc-login-icon {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    #kc-login-widget {
        margin: 20px auto;
        padding: 0 15px;
    }

    .kc-login-container {
        gap: 15px;
    }

    .kc-login-sidebar {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .kc-login-content {
        padding: 20px;
        border-radius: 12px;
    }

    .kc-section-title {
        font-size: 18px;
    }

    .kc-login-header h2 {
        font-size: 20px;
    }

    .kc-login-header p {
        font-size: 13px;
    }

    .kc-input {
        padding: 10px 12px;
        font-size: 16px;
    }

    .kc-password-input {
        padding-right: 40px;
    }

    .kc-login-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .kc-form-group {
        margin-bottom: 18px;
    }

    .kc-form-options {
        margin-bottom: 18px;
        gap: 10px;
    }

    .kc-checkbox-group label {
        font-size: 13px;
    }

    .kc-forgot-link {
        font-size: 12px;
    }

    .kc-login-link {
        font-size: 13px;
    }

    .kc-register-link {
        font-size: 14px;
    }

    .kc-login-footer {
        margin-top: 24px;
        padding-top: 20px;
    }
}
