/* Import color variables from add_invoice.css */
@import url('add_invoice.css');

/* Override Bootstrap variables with our custom colors */
:root {
    --bs-primary: var(--blue-accent);
    --bs-info: var(--blue-soft);
    --bs-primary-rgb: 91, 155, 213;
    --bs-info-rgb: 107, 163, 214;
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', Arial, sans-serif;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e8f4fd 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

/* Main container */
.vh-100 {
    min-height: 100vh;
}

/* Left side styling */
.col-sm-6:first-child {
    background: linear-gradient(135deg, var(--white) 0%, #f8fbff 100%);
    position: relative;
    overflow: hidden;
}

.col-sm-6:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blue-gradient-start) 0%, var(--blue-gradient-end) 100%);
    opacity: 0.05;
    z-index: 0;
}

.col-sm-6:first-child > * {
    position: relative;
    z-index: 1;
}

/* Logo section */
.px-5.ms-xl-4 {
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.px-5.ms-xl-4 i {
    color: var(--blue-accent) !important;
    filter: drop-shadow(0 2px 4px rgba(91, 155, 213, 0.3));
    margin-bottom: 0.5rem;
}

.px-5.ms-xl-4 .h1 {
    color: var(--dark-color);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0;
}

/* Form container */
.h-custom-2 {
    padding: 2rem 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form styling */
form {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

form h3 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form inputs */
.form-outline {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 0.2rem rgba(91, 155, 213, 0.25);
    background: var(--white);
}

.form-label {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--dark-text-muted);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: var(--white);
    padding: 0 0.5rem;
    border-radius: 4px;
}

.form-outline.focused .form-label,
.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
    top: 0;
    font-size: 0.75rem;
    color: var(--blue-accent);
    font-weight: 600;
}

/* Login button */
.login-btn {
    background: linear-gradient(135deg, var(--blue-gradient-start) 0%, var(--blue-gradient-end) 100%);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--white);
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(91, 155, 213, 0.3);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 155, 213, 0.4);
    background: linear-gradient(135deg, var(--blue-hover) 0%, var(--blue-soft) 100%);
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(91, 155, 213, 0.3);
}

/* Links */
.small a,
p a {
    color: var(--blue-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.small a:hover,
p a:hover {
    color: var(--blue-hover);
    text-decoration: underline;
}

/* Alert messages */
.alert {
    border-radius: 12px;
    border: none;
    font-weight: 500;
    margin-bottom: 1rem;
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* Right side image */
.col-sm-6:last-child {
    position: relative;
    overflow: hidden;
}

.col-sm-6:last-child img {
    filter: brightness(0.9) contrast(1.1);
    transition: transform 0.3s ease;
}

.col-sm-6:last-child:hover img {
    transform: scale(1.02);
}

/* Responsive design */
@media (max-width: 768px) {
    .col-sm-6:first-child {
        padding: 1rem;
    }
    
    form {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .px-5.ms-xl-4 {
        padding: 1rem;
        text-align: center;
    }
    
    .h-custom-2 {
        padding: 1rem 0;
        min-height: 50vh;
    }
}

@media (max-width: 576px) {
    form {
        width: 100% !important;
        padding: 1rem;
    }
    
    .form-control {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .login-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Animation for form appearance */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

form {
    animation: slideInUp 0.6s ease-out;
}

/* Floating label animation */
.form-outline {
    position: relative;
}

.form-outline.focused .form-label {
    animation: labelFloat 0.3s ease-out;
}

@keyframes labelFloat {
    from {
        transform: translateY(-50%);
        font-size: 0.9rem;
    }
    to {
        transform: translateY(-50%);
        font-size: 0.75rem;
    }
}

/* Loading state for button */
.login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form validation styles */
.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.validation-message {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Phone number input specific styles */
input[type="tel"] {
    direction: rtl;
    text-align: right;
}

input[type="tel"]::placeholder {
    direction: rtl;
    text-align: right;
}

/* Enhanced form validation feedback */
.form-outline .form-control:focus.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-outline .form-control:focus.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Success and error states for labels */
.form-outline .form-control.is-valid + .form-label {
    color: #28a745;
}

.form-outline .form-control.is-invalid + .form-label {
    color: #dc3545;
}
