/* Reset e Configurações Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --success: #10b981;
    --error: #ef4444;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.page-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.container {
    background: var(--bg-primary);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: var(--shadow-xl);
    position: relative;
}

/* Logo */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    max-width: 280px;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
    border-radius: 20px;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-fallback {
    text-align: center;
}

.logo-fallback h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* Header */
.header-section {
    text-align: center;
    margin-bottom: 32px;
}

.main-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Search Section */
.search-section {
    margin-bottom: 24px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 4px;
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: var(--bg-primary);
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-secondary);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 20px 14px 52px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    font-weight: 500;
}

.search-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.search-button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.search-button:active {
    transform: translateY(0);
}

.search-button i {
    font-size: 14px;
}

/* Result Section */
.result-section {
    margin: 24px 0;
    min-height: 0;
}

/* Divider */
.divider-section {
    display: flex;
    align-items: center;
    margin: 32px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider-text {
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Register Button */
.register-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    border: 2px solid var(--border);
}

.register-button:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.register-button i {
    font-size: 16px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
}

.footer p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.2s;
}

.footer a:hover {
    border-bottom-color: white;
}

/* Tracking Result Styles */
.tracking-result {
    margin-top: 24px;
    animation: fadeIn 0.3s ease;
}

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

.tracking-header {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.tracking-code {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tracking-code strong {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}

.tracking-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.tracking-info div {
    margin-bottom: 4px;
}

.tracking-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Status Timeline */
.status-timeline {
    position: relative;
    padding: 20px 0;
}

.status-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 24px;
}

.status-item:last-child {
    padding-bottom: 0;
}

.status-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 30px;
    bottom: -24px;
    width: 2px;
    background: var(--border);
}

.status-item:last-child::before {
    display: none;
}

.status-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.status-item.active .status-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.status-details {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: 10px;
    position: relative;
}

.status-item.active .status-details {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.status-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.current-status {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Progress Bar */
.progress-container {
    margin: 24px 0;
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Tracking Actions */
.tracking-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-copy,
.btn-new {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-copy {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.btn-copy:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

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

.btn-new:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
    font-weight: 500;
}

.error-message div {
    margin-bottom: 8px;
}

.btn-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Form Section - Cadastro */
.form-section {
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-group label i {
    color: var(--primary);
    font-size: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    font-weight: 500;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-group input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.submit-button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    margin-top: 24px;
}

.submit-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.submit-button i {
    font-size: 18px;
}

/* Success Message - Cadastro */
.success-message {
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeIn 0.3s ease;
}

.success-message strong {
    color: var(--success);
    font-size: 16px;
    display: block;
    margin-bottom: 12px;
}

.success-box {
    background: white;
    padding: 16px;
    border-radius: 10px;
    margin: 12px 0;
}

.tracking-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tracking-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    word-break: break-all;
    margin: 8px 0;
    letter-spacing: 1px;
}

.tracking-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.tracking-date {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
}

/* Back Button */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    border: 2px solid var(--border);
}

.back-button:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.back-button i {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 32px 24px;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .search-button span {
        display: none;
    }
    
    .search-button {
        padding: 12px 16px;
    }
    
    .submit-button {
        font-size: 15px;
        padding: 12px 20px;
    }
    
    .tracking-number {
        font-size: 20px;
    }
}
