:root {
    --primary-color: #4285F4;
    --primary-hover: #3367D6;
    --secondary-color: #34A853;
    --danger-color: #EA4335;
    --warning-color: #FBBC04;
    --muted-color: #9AA0A6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5C9DFF 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    max-width: 520px;
    width: 95%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: var(--primary-color);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.logo-container {
    position: relative;
    z-index: 1;
}

.header-logo {
    height: 60px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.login-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.network-tagline {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.3s both;
    transition: all 0.3s ease;
}

.network-tagline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.network-tagline i {
    color: #4CAF50;
    font-size: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.network-tagline span {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.login-form {
    padding: 2rem 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}



.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-control.error {
    border-color: var(--danger-color);
    background: #fff5f5;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-color);
    z-index: 2;
}

.input-with-icon {
    padding-left: 3rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted-color);
    cursor: pointer;
    z-index: 2;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.password-toggle.active {
    color: var(--primary-color);
    background: rgba(66, 133, 244, 0.1);
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5C9DFF 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.2);
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #4A8BFF 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: var(--muted-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-btn.loading {
    color: transparent;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.forgot-password {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.help-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.help-title {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-bottom: 1rem;
}

.help-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.help-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: var(--muted-color);
    padding: 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 0;
}

.help-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.help-btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.help-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.help-btn:hover .help-number {
    color: rgba(255, 255, 255, 0.9);
}

.guest-mode-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.divider {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.divider span {
    background: white;
    padding: 0 1rem;
    color: var(--muted-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
    z-index: -1;
}

.guest-btn {
    width: 100%;
    background: transparent;
    color: var(--muted-color);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.guest-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.1);
}

.success-message {
    background: var(--secondary-color);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message.show {
    display: block;
}

.alert-danger {
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: none;
}

.alert-danger ul {
    margin: 0;
    padding-left: 1rem;
}

.alert-danger li {
    margin-bottom: 0.25rem;
}

/* Customer Type Selection Styles */
.customer-type-selection {
    margin-bottom: 2rem;
}

.customer-type-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.customer-type-option {
    flex: 1;
    max-width: 150px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.customer-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.customer-type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    min-height: 80px;
    justify-content: center;
}

.customer-type-label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
}

.customer-type-option input[type="radio"]:checked + .customer-type-label,
.customer-type-option.selected .customer-type-label {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #5C9DFF 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.3);
}

.customer-type-label .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.customer-type-label .title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.customer-type-label .subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Form switching styles */
.auth-form {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.auth-form.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-container {
        width: 95%;
        margin: 1rem;
    }
    
    .login-header {
        padding: 1.5rem 1rem;
    }
    
    .login-form {
        padding: 1.5rem 1rem;
    }
    
    .header-logo {
        height: 50px;
    }

    .network-tagline {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        margin-top: 0.8rem;
    }

    .network-tagline i {
        font-size: 0.9rem;
    }
    
    .language-selector {
        top: 15px;
        right: 15px;
        gap: 3px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .customer-type-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .customer-type-option {
        max-width: none;
    }
    
    .customer-type-label {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 0.75rem 1rem;
        min-height: 60px;
    }
    
    .customer-type-label .icon {
        margin-bottom: 0;
        margin-right: 0.75rem;
        font-size: 1.25rem;
    }
    
    .help-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .help-btn {
        padding: 0.75rem;
        font-size: 0.8rem;
        flex: none;
    }
    
    .help-number {
        font-size: 0.75rem;
    }
}

/* Medium screens - adjust container width */
@media (max-width: 600px) {
    .login-container {
        max-width: 100%;
        width: 98%;
        margin: 1rem;
    }
    
    .language-selector {
        top: 10px;
        right: 10px;
        gap: 2px;
    }
    
    .lang-btn {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .help-buttons {
        gap: 0.5rem;
    }
    
    .help-btn {
        padding: 0.6rem;
        font-size: 0.75rem;
    }
    
    .help-number {
        font-size: 0.7rem;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .language-selector {
    right: auto;
    left: 20px;
}

@media (max-width: 768px) {
    [dir="rtl"] .language-selector {
        left: 15px;
    }
}

@media (max-width: 600px) {
    [dir="rtl"] .language-selector {
        left: 10px;
    }
}

[dir="rtl"] .lang-btn {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

[dir="rtl"] .login-title,
[dir="rtl"] .login-subtitle,
[dir="rtl"] .network-tagline span {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

[dir="rtl"] .form-label {
    text-align: right;
}

[dir="rtl"] .input-icon {
    right: auto;
    left: 15px;
}

[dir="rtl"] .input-with-icon {
    padding-left: 15px;
    padding-right: 45px;
}

[dir="rtl"] .help-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .help-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .help-btn i {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .help-btn-content {
    align-items: flex-end;
}

/* Tutorial Styles */
.tutorial-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-trigger:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.4);
}

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.tutorial-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: tutorialSlideIn 0.3s ease-out;
}

@keyframes tutorialSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tutorial-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.tutorial-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.tutorial-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tutorial-body {
    padding: 30px;
    min-height: 300px;
}

.tutorial-step {
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tutorial-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 20px rgba(66, 133, 244, 0.3);
}

.tutorial-step h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.tutorial-step p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.tutorial-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.tutorial-progress {
    margin-bottom: 20px;
}

.tutorial-progress-text {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.tutorial-progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.tutorial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 20%;
}

.tutorial-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.tutorial-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.tutorial-btn-primary {
    background: var(--primary-color);
    color: white;
}

.tutorial-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.tutorial-btn-secondary {
    background: #6c757d;
    color: white;
}

.tutorial-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* RTL Support for Tutorial */
[dir="rtl"] .tutorial-trigger {
    right: auto;
    left: 20px;
}

[dir="rtl"] .tutorial-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .tutorial-buttons {
    flex-direction: row-reverse;
}

/* Responsive Tutorial */
@media (max-width: 768px) {
    .tutorial-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .tutorial-body {
        padding: 20px;
        min-height: 250px;
    }
    
    .tutorial-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .tutorial-step h4 {
        font-size: 1.1rem;
    }
    
    .tutorial-step p {
        font-size: 0.9rem;
    }
    
    .tutorial-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .tutorial-btn {
        width: 100%;
    }
}
