/* static/css/styles.css - Versão Mobile Otimizada */
:root {
    --primary-color: #1b2635;
    --secondary-color: #f8f9fa;
    --accent-color: #3B3D4E;
    --text-color: #333;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --error-color: #dc3545;
    --light-gray: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@font-face {
    font-family: 'SourceSansProRegular';
    src: url('../fonts/SourceSansPro-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'SackersSternHeavy';
    src: url('../fonts/SackersStern-Heavy.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

fieldset {
            border: 2px solid #ddd;
            border-radius: 8px;
            padding: 20px;
            margin: 20px 0;
        }

/* Fontes */
.font-heading {
    font-family: 'SackersSternHeavy', sans-serif;
    font-weight: 300;
    letter-spacing: 0.2em;
}

.font-body {
    font-family: 'SourceSansProRegular', sans-serif;
    font-weight: 300;
    letter-spacing: 0.05em;
}

body {
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
}

/* Header melhorado */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

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

.exit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Welcome text melhorado */
.welcome-text {
    padding: 25px 20px;
    text-align: center;
    background-color: white;
    margin-bottom: 5px;
}

.welcome-text h2 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.welcome-text p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.4;
}

/* Progress bar melhorada */
.progress-container {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    width: 100%;
    transition: width 1s ease;
}

.progress-bar.expiring {
    background: linear-gradient(90deg, #ec2c2c6e 0%, #fa0101 100%);
}

/* Cards melhorados */
.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 0 20px 20px;
    overflow: hidden;
}

.card-title {
    font-size: 16px;
    font-family: 'SackersSternHeavy', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
    background-color: #fafafa;
    position: relative;
}

.card-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-color);
}

.card-content {
    padding: 20px;
}

/* Form groups melhorados */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.form-control {
    flex: 1;
    min-width: 0;
}

/* Labels melhorados */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'SourceSansProRegular', sans-serif;
    font-size: 14px;
}

.required::after {
    content: "*";
    color: var(--error-color);
    margin-left: 3px;
    font-weight: bold;
}

.borderError {
    border-color: var(--error-color) !important;
}

.borderSuccess {
    border-color: var(--success-color) !important;
}

/* Inputs melhorados */
input[type="tel"],
input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: white;
    font-family: 'SourceSansProRegular', sans-serif;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 61, 78, 0.1);
}

/* Select melhorado */
select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23333' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    color: black;
}

/* CEP input wrapper */
.cep-input-wrapper {
    position: relative;
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Form info */
.form-info {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
    line-height: 1.3;
}

/* Luxury divider */
.luxury-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
    margin: 25px 0;
}

/* Checkboxes melhorados */
#div_politicas_privacidade {
    margin-bottom: 20px;
}

#div_politicas_privacidade label,
#div_marketing label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    font-weight: normal;
}

#div_politicas_privacidade input[type="checkbox"],
#div_marketing input[type="checkbox"] {
    width: 20px !important;
    height: 20px;
    margin-right: 12px !important;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent-color);
}

#div_politicas_privacidade a,
#div_marketing a {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Botão melhorado */
.btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 18px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'SourceSansProRegular', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 20px;
}

.btn-block {
    display: block;
    width: calc(100% - 40px);
}

.btn:hover {
    background-color: #2c2e3a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-accent {
    background-color: var(--accent-color);
    color: #ffffff;
}

.btn-accent:hover {
    background-color: #2c2e3a;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 12px;
    background-color: white;
    margin-top: 20px;
}

/* Loading */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin: 20px;
    display: none;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Elementos de luxo */
.luxury-element {
    position: relative;
}

.brand-accent {
    color: var(--accent-color);
}

.logo span {
    color: var(--accent-color);
}

/* Melhorias específicas para iOS */
@supports (-webkit-appearance: none) {

    input[type="text"],
    input[type="date"],
    select {
        -webkit-appearance: none;
        -webkit-border-radius: 8px;
        color:black;
    }
}

/* Responsivo para diferentes tamanhos de iPhone */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

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

    .card-title {
        font-size: 15px;
        padding: 15px 20px;
    }

    .card-content {
        padding: 20px;
    }

    input[type="text"],
    input[type="date"],
    select,
    .btn {
        font-size: 16px;
        padding: 16px;
    }

    .btn {
        padding: 18px;
    }
}

@media (max-width: 390px) {
    .card {
        margin: 0 15px 15px;
    }

    .btn {
        margin: 0 15px;
        width: calc(100% - 30px);
    }

    .card-content {
        padding: 16px;
    }

    .welcome-text {
        padding: 20px 16px;
    }

    .alert {
        margin: 15px;
    }
}

/* Ajustes para iPhone SE e menores */
@media (max-width: 320px) {
    .welcome-text h2 {
        font-size: 20px;
    }

    .card-title {
        font-size: 14px;
        padding: 16px;
    }

    input[type="text"],
    input[type="date"],
    select {
        padding: 14px;
    }
}

/* Melhorar a experiência de toque */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 20px;
    }

    input[type="text"],
    input[type="date"],
    select {
        padding: 18px;
    }

    .search-btn {
        padding: 12px;
    }
}

/* Modal */
/* Adicione estes estilos ao seu arquivo styles.css */

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Conteúdo do modal */
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
}

/* Botão de fechar */
.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    color: #000;
    background-color: #f0f0f0;
}

/* Título do modal */
.modal-content h2 {
    color: #2c2c2c;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
}

/* Texto do modal */
.modal-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Campo de input do CPF */
#cpfDigits {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    font-family: monospace;
}

#cpfDigits:focus {
    outline: none;
    border-color: #c9aa7c;
    box-shadow: 0 0 0 3px rgba(201, 170, 124, 0.1);
}

/* Botão confirmar CPF */
#confirmCpf {
    margin: 0px;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #c9aa7c 0%, #b8956a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#confirmCpf:hover {
    background: linear-gradient(135deg, #b8956a 0%, #a68459 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 170, 124, 0.3);
}

#confirmCpf:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(201, 170, 124, 0.2);
}

/* Responsividade */
@media (max-width: 480px) {
    .modal {
        width: 95%;
        margin: 0 auto;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    #cpfDigits {
        font-size: 16px;
        padding: 12px;
    }
    
    #confirmCpf {
        padding: 12px;
        font-size: 14px;
    }
}

/* Estado de loading para o botão */
#confirmCpf:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Animação de saída */
.modal.closing {
    animation: modalFadeOut 0.3s ease-in forwards;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}