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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.header h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    opacity: 0.9;
    font-size: 0.95em;
}

/* Login Form */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    margin: 50px auto;
}

.login-container h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 300;
}

/* Main App */
.main-app {
    display: none;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row.triple {
    grid-template-columns: 1fr 1fr 1fr;
}

label {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
    font-size: 0.95em;
}

input, select, textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4a90e2;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.button {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

.button:active {
    transform: translateY(-1px);
}

.button-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.button-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.button-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.photo-section {
    margin-top: 20px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.photo-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-5px);
}

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

.photo-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.photo-delete:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.1);
}

.equipment-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.equipment-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.equipment-info {
    flex: 1;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

.signature-pad {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin: 20px 0;
    touch-action: none;
    background: white;
    cursor: crosshair;
}

.preview-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
}

.preview-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.preview-content {
    line-height: 1.8;
}

.preview-content strong {
    color: #34495e;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.location-info {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
    padding: 12px 18px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #2980b9;
    border: 1px solid #bee5eb;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 5px;
    font-weight: 500;
}

.success-message {
    color: #27ae60;
    font-size: 0.9em;
    margin-top: 5px;
    font-weight: 500;
}

.navbar {
    background: white;
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.status-indicator {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft { background: #f39c12; color: white; }
.status-signed { background: #27ae60; color: white; }
.status-completed { background: #8e44ad; color: white; }

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row.triple {
        grid-template-columns: 1fr;
    }
    
    .app-container {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Animaciones adicionales */
.form-container {
    animation: slideUp 0.6s ease;
}

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

.section {
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
