@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #0d7658;
    --secondary-color: #afdf70;
    --dark-color: #083030;
    --text-color: #333;
    --light-color: #fff;
    --border-radius: 12px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    --input-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    --button-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --transition-fast: all 0.1s ease;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.container-fluid {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
}

.card {
    background: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}


/* Cabeçalho mantido estático */
.card-header {
    background: linear-gradient(to right, #009029ba, #afdf70);
    padding: 20px;
    display: flex;
    align-items: center;
    color: var(--light-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    height: 40px;
    margin-right: 200px;
    
}

.card-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-align: left;
    text-shadow: 0 1px 2px rgb(0 0 0 / 57%);
}

.main-content {
    display: flex;
    flex-direction: row;
}

.card-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 300px;
    background: var(--light-color);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 15px;
    width: 100%;
    position: relative;
    padding-top: 5px;
}

.form-row {
    display: flex;
    gap: 15px;
    width: 100%;
}

.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 13px;
    text-align: left;
    transform-origin: left center;
    transition: var(--transition-fast);
}

input, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition-fast), box-shadow 0.1s ease;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    background-color: #fdfdfd;
    box-shadow: var(--input-shadow);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 118, 88, 0.1), 0 3px 6px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    animation: input-focus 0.3s ease-out;
}

input:focus + label, 
select:focus + label {
    color: var(--primary-color);
    transform: translateY(-2px) scale(0.95);
}

input:valid, select:valid {
    border-left: 2px solid var(--secondary-color);
    box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 16%);
}

@keyframes input-focus {
    0% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    flex: 1;
    box-shadow: var(--button-shadow);
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-bottom-color: transparent;
}

.btn:active {
    transform: translateY(1px);
    border-bottom-width: 1px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0a5e46;
    box-shadow: 0 5px 15px rgba(13, 118, 88, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Efeito de ripple nos botões */
.btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.preview-container {
    padding: 25px;
    background: #f9f9f9;
    border-left: 1px solid #eee;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.preview-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
    text-align: center;
    position: relative;
    display: inline-block;
    margin: 0 auto 15px;
    letter-spacing: 0.5px;
    text-shadow: 0px 3px 2px rgb(208 208 208 / 76%);
}

.preview-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.canvas-wrapper {
    background: linear-gradient(to bottom, #fff, #f9f9f9);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.05),
        inset 0 0 30px rgba(0, 0, 0, 0.02);
    margin-bottom: 15px;
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-fast);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.canvas-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.canvas-wrapper:hover {
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

canvas {
    width: 300px;
    height: 150px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    background-color: #fff;
    transition: var(--transition-fast);
}

/* Animação quando a assinatura é gerada */
@keyframes signature-generated {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.signature-generated {
    animation: signature-generated 0.4s ease-out forwards;
}

.preview-note {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 10px;
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: -10px;
    margin-bottom: 10px;
    min-height: 20px;
    text-align: left;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

/* Efeito para formulário válido */
.form-valid .card-body {
    background-image: radial-gradient(circle at 90% 80%, rgba(175, 223, 112, 0.03), transparent 60%);
}

/* Responsividade */
@media (max-width: 768px) {
    .card {
        max-width: 95%;
        flex-direction: column;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .preview-container {
        border-left: none;
        border-top: 1px solid #eee;
    }
    
    .preview-title::after {
        left: 20%;
        right: 20%;
    }
}