:root {
    --primary-color: #ff6b35;
    --primary-dark: #e85a28;
    --secondary-color: #004e89;
    --accent-color: #1aa3ff;
    --success-color: #4caf50;
    --text-dark: #1a1a2e;
    --text-light: #f5f5f5;
    --bg-light: #f8f9fa;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(26, 163, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
    position: relative;
    z-index: 1;
}

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

.auth-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.fitness-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.auth-header p {
    font-size: 14px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.auth-body {
    padding: 40px 30px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.error-message {
    background: #fee;
    border-left: 4px solid #f44336;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: shake 0.5s ease-in-out;
}

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

.consent-scopes {
    margin: 25px 0;
}

.scope-item {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.scope-item:hover {
    border-color: var(--accent-color);
    background: white;
    transform: translateX(5px);
}

.scope-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.scope-label {
    flex: 1;
}

.scope-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

.scope-description {
    color: #666;
    font-size: 13px;
}

.client-info {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    border-left: 4px solid var(--accent-color);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.client-info strong {
    color: var(--secondary-color);
    font-size: 16px;
}

.auth-footer {
    text-align: center;
    padding: 20px;
    background: var(--bg-light);
    color: #666;
    font-size: 12px;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin-top: 20px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 480px) {
    .auth-container {
        border-radius: 0;
    }

    .auth-header {
        padding: 30px 20px;
    }

    .auth-body {
        padding: 30px 20px;
    }

    .fitness-icon {
        font-size: 36px;
    }

    .auth-header h1 {
        font-size: 24px;
    }
}

/* ===========================
   PROFILES PAGE STYLES
   =========================== */

.profiles-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.profiles-panel {
    background: white;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.panel-header {
    padding: 30px 20px 20px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    z-index: 10;
}

.panel-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 700;
}

.panel-header p {
    font-size: 14px;
    opacity: 0.9;
}

.profiles-list {
    padding: 10px;
}

.profile-item {
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: white;
    text-decoration: none;
    color: inherit;
    display: block;
}

.profile-item:hover {
    background: var(--bg-light);
    transform: translateX(5px);
}

.profile-item.active {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(26, 163, 255, 0.15);
}

.profile-item-period {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.profile-item-dates {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.empty-state {
    padding: 60px 30px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #666;
}

.details-panel {
    overflow-y: auto;
    padding: 40px;
}

.details-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: white;
}

.details-empty-content {
    max-width: 400px;
}

.details-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.details-empty h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: white;
}

.details-empty p {
    font-size: 16px;
    opacity: 0.9;
}

.details-content {
    max-width: 900px;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.details-header {
    margin-bottom: 40px;
}

.details-period {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.details-goal {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.details-dates {
    font-size: 15px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.photos-section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.upload-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-photos {
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.no-photos-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-photos p {
    color: #666;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 24px;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-light);
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #fff5f0;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #ffe8dc;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area p {
    color: #666;
    font-size: 14px;
}

.upload-area .primary-text {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 16px;
    margin-bottom: 4px;
}

input[type="file"] {
    display: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.preview-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preview-item .remove-btn:hover {
    background: #ef4444;
    color: white;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

@media (max-width: 1024px) {
    .profiles-container {
        grid-template-columns: 1fr;
    }

    .profiles-panel {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 40vh;
    }

    .details-panel {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .panel-header {
        padding: 20px 16px 16px;
    }

    .panel-header h1 {
        font-size: 20px;
    }

    .details-panel {
        padding: 20px 16px;
    }

    .details-content {
        padding: 30px 20px;
    }

    .details-goal {
        font-size: 20px;
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
}