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

html, body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #1e293b;
}

.container {
    width: 100%;
    max-width: 550px;
}

.form-wrapper {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15),
                0 0 1px rgba(15, 23, 42, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    border: none;
}

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    color: #ffffff;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #ffffff;
    text-transform: none;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header p {
    font-size: 14px;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.9);
    margin: 5px 0;
}

form {
    padding: 35px 30px;
    pointer-events: auto;
}

.form-group {
    margin-bottom: 24px;
    pointer-events: auto;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f8fafc;
    color: #1e293b;
}

input[type="text"]::placeholder,
input[type="file"]::placeholder {
    color: #94a3b8;
}

input[type="text"],
input[type="file"],
button,
.btn-primary,
.btn-secondary,
.upload-area,
.tab-btn,
.btn-camera {
    pointer-events: auto;
}

input[type="text"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    touch-action: manipulation;
    pointer-events: auto;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f1f5ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f1f5ff;
    transform: scale(1.02);
}

.upload-text p {
    color: #cddc39;
    font-weight: 600;
    margin-bottom: 5px;
}

.upload-text small {
    color: #64748b;
    display: block;
    font-weight: 500;
}

.upload-text small {
    color: #94a3b8;
}

/* Abas */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Câmera */
.camera-container {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

#cameraVideo {
    width: 100%;
    height: auto;
    min-height: 300px;
    max-width: 100%;
    border-radius: 8px;
    background: #000;
    margin-bottom: 15px;
    display: block;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-camera {
    padding: 12px 20px;
    background: #cddc39;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-camera:hover {
    background: #b0bec5;
    transform: translateY(-2px);
}

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

.btn-camera:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Preview */
.preview {
    margin-top: 15px;
    text-align: center;
}

.preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview .preview-info {
    margin-top: 10px;
    font-size: 12px;
    color: #b0bec5;
}

/* Modal Editor */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1e293b;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #667eea;
}

.modal-body {
    padding: 20px;
}

.editor-container {
    position: relative;
    margin-bottom: 20px;
}

.crop-area {
    position: relative;
    display: inline-block;
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

#editorImage {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
}

.crop-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 267px;
    border: 3px solid #667eea;
    background: rgba(102, 126, 234, 0.08);
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    z-index: 100;
}

.crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #667eea;
    border: 3px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    /* Aumentar área de toque para mobile */
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.15);
    transition: all 0.2s ease;
    pointer-events: auto;
    z-index: 101;
}

.crop-handle:active {
    width: 18px;
    height: 18px;
    box-shadow: 0 0 0 12px rgba(102, 126, 234, 0.25);
}

.crop-handle-nw {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.crop-handle-ne {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.crop-handle-sw {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.crop-handle-se {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.editor-info {
    background: #2d2d2d;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #cddc39;
}

.editor-info p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #cddc39;
    font-weight: 600;
}

.editor-info small {
    color: #b0bec5;
    font-size: 12px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 2px solid #cddc39;
}

.btn-primary,
.btn-secondary {
    padding: 11px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f1f5ff;
    color: #667eea;
    border: 2px solid #e0e7ff;
}

.btn-secondary:hover {
    background: #e0e7ff;
    border-color: #667eea;
}

/* LGPD Notice */
.lgpd-notice {
    background: linear-gradient(135deg, #f0f4ff 0%, #f5f3ff 100%);
    border: 2px solid #e0e7ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    font-size: 13px;
}

.lgpd-notice h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
}

.lgpd-notice p {
    color: #475569;
    margin-bottom: 10px;
    line-height: 1.6;
}

.lgpd-notice ul {
    list-style: none;
    padding-left: 0;
    margin: 12px 0;
}

.lgpd-notice li {
    color: #475569;
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
}

.lgpd-notice li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px 30px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
}

.footer p {
    margin: 6px 0;
    line-height: 1.6;
}

/* Desabilitar scroll durante drag */
body.dragging-crop {
    overflow: hidden;
}

.modal.dragging-crop {
    overflow: hidden;
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .crop-box {
        width: 150px;
        height: 200px;
    }

    #cropImage {
        max-height: 300px;
    }
}

.error {
    color: #ff6b6b;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
}

.message.success {
    background: #2d5016;
    color: #cddc39;
    border: 1px solid #cddc39;
    display: block;
}

.message.error {
    background: #5a1a1a;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    display: block;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

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

.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

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

.footer {
    background: #f8f9fa;
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
}

/* Responsivo */
@media (max-width: 600px) {
    .header h1 {
        font-size: 24px;
    }

    form {
        padding: 20px 15px;
    }

    .upload-area {
        padding: 20px;
    }

    .btn-submit {
        padding: 12px;
        font-size: 14px;
    }
}

