/* Modern Login Page Styles - Enhanced Version */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #01c0c8;
    --primary-dark: #009ba3;
    --secondary-color: #ab9ae5;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Медицинский фон: светлые холодные тона, спокойствие и чистота */
.authentication {
    background: linear-gradient(165deg, #e8f4f8 0%, #f0f9fc 35%, #f5fbfd 70%, #fafcfd 100%);
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.authentication::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"><defs><pattern id="plus" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M28 0h4v60h-4zM0 28h60v4H0z" fill="%2301c0c8" opacity="0.06"/></pattern></defs><rect width="100" height="100" fill="url(%23plus)"/></svg>');
    pointer-events: none;
}

/* Enhanced Container */
.container {
    position: relative;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    z-index: 1;
    padding: 20px;
}

/* Enhanced Card */
.card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    animation: slideUp 0.6s ease-out;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

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

/* Enhanced Title */
.card .title {
    position: relative;
    z-index: 1;
    border: none;
    margin: 0 0 40px;
    padding: 0;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    text-transform: none;
    text-align: center;
    letter-spacing: -0.5px;
}

.card .title span {
    font-size: 16px;
    display: block;
    margin: 8px 0 0 0;
    line-height: 1.5;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
}

/* Enhanced Form Controls */
.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(1, 192, 200, 0.1);
    transform: translateY(-1px);
}

.form-control.is-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

/* Enhanced Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.btn-primary::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;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(1, 192, 200, 0.3);
}

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

/* Enhanced Form Groups */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group.row {
    margin: 0;
}

.col-form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding: 0;
    text-align: left;
    display: block;
}

.col-md-8, .col-md-12 {
    padding: 0;
}

/* Enhanced Form Check */
.form-check {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Enhanced Invalid Feedback */
.invalid-feedback {
    display: block;
    font-size: 14px;
    color: #e74c3c;
    margin-top: 8px;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Utility Classes */
.offset-md-4 {
    margin-left: 0;
}

.mb-0 {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .card .title {
        font-size: 24px;
    }
    
    .form-control {
        padding: 14px 16px;
    }
}

/* Loading State */
.btn-primary.loading {
    pointer-events: none;
}

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

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

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.form-control:focus,
.btn-primary:focus,
.form-check-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
