﻿/* 
 * SoftTur Modern Auth Pages - Bootstrap 5 Styles
 * Versão: 3.0 - SoftTur Brand Colors (Red/Burgundy)
 * Data: 2025
 */

/* ===== Variables ===== */
:root {
    --primary-color: #C41E3A;
    --primary-hover: #A01830;
    --primary-light: #E8475D;
    --primary-dark: #8B1428;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #f5a623;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #2d3436;
    --body-bg: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    --header-bg: linear-gradient(135deg, #C41E3A 0%, #A01830 100%);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --card-radius: 12px;
    --input-radius: 6px;
    --btn-radius: 6px;
}

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.auth-body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===== Auth Container ===== */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    background: #ffffff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--primary-color);
}

.auth-card-header {
    background: #ffffff;
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.auth-logo {
    max-width: 220px;
    max-height: 90px;
    margin-bottom: 15px;
}

.auth-card-header h4 {
    color: var(--dark-color);
    margin: 0;
    font-weight: 600;
    font-size: 1.15rem;
}

.auth-card-header .subtitle {
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

.auth-card-body {
    padding: 30px;
}

/* ===== Form Styles ===== */
.form-floating {
    margin-bottom: 20px;
}

.form-floating > .form-control {
    border-radius: var(--input-radius);
    border: 1px solid #dee2e6;
    padding: 1rem 0.75rem;
    height: calc(3.5rem + 2px);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(196, 30, 58, 0.15);
}

.form-floating > label {
    padding: 1rem 0.75rem;
    color: #6c757d;
}

.form-check {
    margin-bottom: 20px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== Buttons ===== */
.btn-auth-primary {
    background: var(--header-bg);
    border: none;
    border-radius: var(--btn-radius);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.35);
    background: var(--primary-hover);
}

.btn-auth-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-auth-secondary {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: var(--btn-radius);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--secondary-color);
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-auth-secondary:hover {
    background: var(--light-color);
    border-color: var(--secondary-color);
}

.btn-auth-success {
    background: var(--success-color);
    border: none;
    border-radius: var(--btn-radius);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-auth-success:disabled {
    opacity: 0.7;
}

.btn-auth-danger {
    background: var(--danger-color);
    border: none;
    border-radius: var(--btn-radius);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-auth-danger:hover {
    background: #bb2d3b;
}

/* ===== Alerts ===== */
.alert {
    border-radius: var(--input-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    border: none;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* ===== Links ===== */
.auth-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.auth-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.auth-links .link-divider {
    color: #dee2e6;
    margin: 0 10px;
}

/* ===== Portal Links ===== */
.portal-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.portal-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--btn-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.portal-link-client {
    background: #fef2f2;
    color: var(--primary-color);
    border: 1px solid #fecaca;
}

.portal-link-client:hover {
    background: #fee2e2;
    color: var(--primary-hover);
}

.portal-link-partner {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.portal-link-partner:hover {
    background: #e0f2fe;
    color: #075985;
}

.portal-link i {
    font-size: 1.1rem;
}

/* ===== Footer ===== */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
}

.auth-footer a {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.auth-footer a:hover {
    opacity: 1;
}

.auth-footer img {
    max-height: 30px;
}

/* ===== Database Selector ===== */
.db-selector {
    background: #f8f9fa;
    border-radius: var(--input-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.db-selector h6 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 600;
}

/* ===== Test Environment Badge ===== */
.test-environment {
    background: var(--warning-color);
    color: #000;
    padding: 10px 20px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
    border-radius: var(--input-radius);
}

/* ===== Icon in Input ===== */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 5;
}

.input-icon-wrapper .form-control {
    padding-left: 45px;
}

/* ===== Loading State ===== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Security Tips Page ===== */
.tips-card {
    max-width: 700px;
}

.tips-card .auth-card-body {
    padding: 40px;
}

.tip-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #dee2e6;
}

.tip-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tip-item h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-item h5 .tip-number {
background: var(--header-bg);
color: #fff;
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
    font-size: 0.875rem;
}

.tip-item p {
    color: #495057;
    line-height: 1.7;
    margin: 0;
    text-align: justify;
}

.tip-item a {
    color: var(--primary-color);
}

/* ===== reCAPTCHA ===== */
.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* ===== Responsive ===== */
@media (max-width: 576px) {
    .auth-wrapper {
        padding: 10px;
    }
    
    .auth-card-header {
        padding: 20px;
    }
    
    .auth-card-body {
        padding: 20px;
    }
    
    .auth-logo {
        max-width: 150px;
    }
    
    .portal-links {
        flex-direction: column;
    }
    
    .tips-card .auth-card-body {
        padding: 20px;
    }
}

/* ===== Animation ===== */
.auth-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Form Select ===== */
.form-select {
    border-radius: var(--input-radius);
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ===== Icon Button ===== */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #dee2e6;
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== Header with Action ===== */
.auth-card-header-actions {
    position: absolute;
    top: 15px;
    right: 15px;
}

.auth-card-header {
    position: relative;
}

/* ===== Security Tips Modal ===== */
.modal-tips .modal-dialog {
    max-width: 50%;
    margin: 1.75rem auto;
}

.modal-tips .modal-content {
    border-radius: var(--card-radius);
    border: none;
    box-shadow: var(--card-shadow);
}

.modal-tips .modal-header {
    background: #fff;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding: 20px 25px;
}

.modal-tips .modal-header .modal-title {
    font-weight: 600;
}

.modal-tips .modal-header .btn-close {
    opacity: 0.6;
}

.modal-tips .modal-header .btn-close:hover {
    opacity: 1;
}

.modal-tips .modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-tips .tip-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
}

.modal-tips .tip-item h5 {
    font-size: 1rem;
}

.modal-tips .tip-item p {
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 992px) {
    .modal-tips .modal-dialog {
        max-width: 90%;
    }
}

@media (max-width: 576px) {
    .modal-tips .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .modal-tips .modal-body {
        padding: 15px;
    }
}

/* ===== Footer Logo ===== */
.auth-footer-logo {
    max-height: 35px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.auth-footer-logo:hover {
    opacity: 1;
}

