:root {
    --primary: #0f172a;
    --primary-foreground: #f8fafc;
    --secondary: #f1f5f9;
    --secondary-foreground: #0f172a;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;
    --destructive: #ef4444;
    --destructive-foreground: #fef2f2;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --ring: #3b82f6;
    --radius: 0.5rem;
}

.form-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: box-shadow 0.2s ease;
}

.form-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.form-label .required {
    color: var(--destructive);
    font-weight: 600;
}

.form-control,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--primary);
    background-color: white;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder,
.form-textarea::placeholder {
    color: var(--muted-foreground);
    opacity: 0.6;
}

.form-control.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--destructive);
}

.form-control.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--destructive);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.autocomplete-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    margin-top: 0.25rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    animation: slideDown 0.2s ease;
}

.autocomplete-item {
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 0.875rem;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--accent);
}

.autocomplete-loading {
    padding: 0.625rem 0.875rem;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: calc(var(--radius) - 2px);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--accent);
}

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

.form-section-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.modal-body {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.home-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.home-card:hover {
    border-color: var(--ring);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.home-card-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 2px);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.home-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.home-card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.input-group-text {
    background-color: var(--muted);
    border-color: var(--border);
    color: var(--muted-foreground);
    transition: all 0.2s ease;
}

.input-group:focus-within .input-group-text {
    background-color: var(--ring);
    color: white;
    border-color: var(--ring);
}

.input-group .form-control:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--muted-foreground);
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--muted);
    border-color: var(--muted);
    color: var(--primary);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Alinhar labels no topo e campos no bottom das rows */
.row {
    align-items: flex-start;
}

.row > [class*="col-"] {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.row > [class*="col-"] > .form-group {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mb-3 {
    margin-bottom: 1.8rem !important;
}

.row > [class*="col-"] > .form-group > .form-control,
.row > [class*="col-"] > .form-group > .form-select {
    margin-top: auto;
}

@media (max-width: 768px) {
    .form-card {
        padding: 1.5rem !important;
    }
    
    .home-grid {
        grid-template-columns: 1fr;
    }
}

