/* Canada.ca Official Styles - Optimized */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: "Lato", sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #fff;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 999999;
}

.skip-link a {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link a:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px;
    background: #000;
    color: #fff;
    text-decoration: none;
}

/* Container and Grid */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-xs-3, .col-xs-6, .col-xs-9, .col-xs-12,
.col-sm-5, .col-sm-7, .col-sm-12,
.col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9,
.col-lg-2, .col-lg-4, .col-lg-8, .col-lg-10 {
    padding: 0 15px;
    flex: 1;
}

.col-xs-3 { flex: 0 0 25%; }
.col-xs-6 { flex: 0 0 50%; }
.col-xs-9 { flex: 0 0 75%; }
.col-xs-12 { flex: 0 0 100%; }

/* Utility classes */
.text-right { text-align: right; }
.text-center { text-align: center; }
.pull-right { float: right; }
.wb-inv { 
    position: absolute !important; 
    width: 1px; 
    height: 1px; 
    margin: -1px; 
    border: 0; 
    padding: 0; 
    white-space: nowrap; 
    clip-path: inset(50%); 
    overflow: hidden; 
}
.list-inline { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}
.list-inline li { 
    display: inline-block; 
    margin-right: 10px; 
}
.list-unstyled { 
    list-style: none; 
    padding: 0; 
}
.mrgn-bttm-0 { margin-bottom: 0; }
.mrgn-tp-sm { margin-top: 0.75em; }
.mrgn-bttm-sm { margin-bottom: 0.75em; }
.mrgn-tp-lg { margin-top: 1.5em; }
.mrgn-lft-sm { margin-left: 0.75em; }

/* Header styles */
header {
    background: #fff;
    border-bottom: 4px solid #335075;
}

#wb-bnr {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 0;
}

#wb-lng {
    font-size: 13px;
}

#wb-lng a {
    color: #335075;
    text-decoration: none;
}

#wb-lng a:hover {
    text-decoration: underline;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brand img {
    height: 40px;
    width: auto;
    max-width: 100%;
}

/* Search */
#wb-srch {
    margin-top: 10px;
}

#wb-srch h2 {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.wb-srch-qry {
    margin-right: 5px;
}

.search-icon {
    vertical-align: middle;
    margin-right: 4px;
    color: currentColor;
    transition: transform 0.3s ease;
}

/* Form Container */
.visa-form-container {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 50%, #edf2f7 100%);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #ddd;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.visa-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #335075;
}

.visa-form-container h2 {
    font-weight: 700;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 20px;
    position: relative;
}

.visa-form-container h3 {
    font-weight: 600;
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 15px;
}

.visa-form-container p {
    color: #555;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    width: 100%;
    display: block;
    clear: both;
}

.form-control {
    display: block;
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-control:hover {
    border-color: #cbd5e0;
}

.form-control::placeholder {
    color: #a0aec0;
    font-weight: 400;
    font-style: italic;
}

/* Select sin flechas - MEJORADO para parecer más oficial */
select.form-control {
    padding: 12px 16px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.form-control:focus {
    outline: none;
    border-color: #335075;
    box-shadow: 0 0 0 3px rgba(51, 80, 117, 0.2);
}

select.form-control:hover {
    border-color: #999;
}

select.form-control option {
    padding: 12px 16px;
    font-size: 16px;
    color: #333;
    background-color: #ffffff;
    white-space: normal;
    line-height: 1.5;
}

label, .control-label {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
    text-align: left;
    padding: 0;
}

.required {
    color: #d3080c;
    font-weight: 700;
    margin-left: 2px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    margin-bottom: 10px;
    margin-right: 10px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 48px;
    box-sizing: border-box;
}

.btn:last-child {
    margin-right: 0;
}

.btn-primary {
    color: #fff;
    background-color: #335075;
    border-color: #335075;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #26395f;
    border-color: #26395f;
    text-decoration: underline;
}

.btn-default {
    color: #335075;
    background-color: #eaebed;
    border-color: #ddd;
}

.btn-default:hover {
    background-color: #d4d6da;
    border-color: #ccc;
    text-decoration: underline;
}

#wb-srch .btn {
    background-color: #335075;
    border-color: #335075;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
}

#wb-srch .btn:hover {
    background-color: #26496d;
    border-color: #26496d;
}

/* Alerts */
.alert {
    position: relative;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-info {
    background-color: #d7faff;
    border-left: 4px solid #269abc;
    color: #245269;
}

.alert-info h3 {
    color: #245269;
    font-weight: 600;
    margin-top: 0;
    font-size: 18px;
}

/* Checkbox */
.checkbox {
    margin-bottom: 15px;
    position: relative;
}

.checkbox label {
    font-weight: normal;
    color: #333;
    line-height: 1.4;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    padding-left: 5px;
}

.checkbox input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox a {
    color: #284162;
    text-decoration: underline;
    font-weight: normal;
}

.checkbox a:hover {
    color: #0535d2;
}

/* App bar */
.app-bar {
    background: #f5f5f5;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 0;
}

.app-bar .h3 {
    color: #335075;
    font-size: 1.17em;
    font-weight: bold;
    text-decoration: none;
    margin: 0;
}

.app-bar .h3:hover {
    text-decoration: underline;
}

.ip-cover-img {
    text-align: right;
}

.ip-cover-img img {
    max-width: 100%;
    height: auto;
}

/* Breadcrumb */
#wb-bc {
    background: #f5f5f5;
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

#wb-bc h2 {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.breadcrumb {
    padding: 0;
    margin: 0;
    list-style: none;
    background-color: transparent;
    border-radius: 0;
}

.breadcrumb li {
    display: inline-block;
}

.breadcrumb li + li:before {
    content: "> ";
    padding: 0 5px;
    color: #ccc;
}

.breadcrumb a {
    color: #335075;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Main content */
main {
    padding: 30px 0;
}

h1 {
    font-size: 2.3em;
    font-weight: 400;
    margin: 0 0 0.83em;
    color: #333;
}

h2 {
    font-size: 1.8em;
    font-weight: 400;
    margin: 1.5em 0 0.83em;
    color: #333;
}

h3 {
    font-size: 1.3em;
    font-weight: 400;
    margin: 1.67em 0 0.83em;
    color: #333;
}

.lead {
    font-size: 1.2em;
    font-weight: 300;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* Panels */
.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.panel-default {
    border-color: #ddd;
}

.panel-heading {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    background-color: #f5f5f5;
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.panel-body {
    padding: 20px;
    background-color: #fff;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}

/* Immigration sections */
.immigration-info-section {
    background-color: #f5f5f5;
    padding: 40px 0;
    border-top: 1px solid #ddd;
}

.step-section {
    margin-bottom: 30px;
    position: relative;
    padding-left: 80px;
}

.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    background-color: #335075;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.step-section h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 5px;
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.step-list li:before {
    
    position: absolute;
    left: 0;
    color: #335075;
    font-size: 16px;
    font-weight: bold;
}

.step-list a {
    color: #284162;
    text-decoration: underline;
    font-weight: normal;
}

.step-list a:hover {
    color: #0535d2;
}

.documents-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.documents-section h4 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 0;
}

.documents-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.documents-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.documents-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #335075;
    font-size: 16px;
    font-weight: bold;
}

.documents-list a {
    color: #284162;
    text-decoration: underline;
    font-weight: normal;
}

.documents-list a:hover {
    color: #0535d2;
}

.immigration-links-section {
    background-color: #335075;
    color: white;
    padding: 40px 0;
}

.immigration-links-section h3 {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    margin-top: 0;
    text-align: center;
}

.immigration-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.immigration-links li {
    margin-bottom: 12px;
    padding-left: 0;
}

.immigration-links a {
    color: white;
    text-decoration: underline;
    font-weight: normal;
    font-size: 16px;
    display: block;
    padding: 5px 0;
}

.immigration-links a:hover {
    color: #d7faff;
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 10px;
    transition: all 0.3s ease;
}

/* Footer */
#wb-info {
    background: #f5f5f5;
    border-top: 4px solid #335075;
    margin-top: 50px;
}

.landscape {
    padding: 30px 0;
    border-bottom: 1px solid #e5e5e5;
}

.wb-navcurr h2 {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.landscape ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.landscape li {
    margin-bottom: 10px;
    break-inside: avoid;
}

.landscape a {
    color: #335075;
    text-decoration: none;
}

.landscape a:hover {
    text-decoration: underline;
}

.ftr-urlt-lnk ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.ftr-urlt-lnk li {
    margin-right: 20px;
    margin-bottom: 10px;
}

.ftr-urlt-lnk a {
    color: #335075;
    text-decoration: none;
    font-size: 14px;
}

.ftr-urlt-lnk a:hover {
    text-decoration: underline;
}

/* Responsive Design - MEJORADO */
@media (min-width: 768px) {
    .col-sm-5 { flex: 0 0 41.666667%; }
    .col-sm-7 { flex: 0 0 58.333333%; }
    .col-sm-12 { flex: 0 0 100%; }
    .col-xs-12.col-md-6 {
        width: 50%;
        flex: 0 0 50%;
    }
}

@media (min-width: 992px) {
    .col-md-3 { flex: 0 0 25%; }
    .col-md-4 { flex: 0 0 33.333333%; }
    .col-md-6 { flex: 0 0 50%; }
    .col-md-8 { flex: 0 0 66.666667%; }
    .col-md-9 { flex: 0 0 75%; }
}

@media (min-width: 1200px) {
    .col-lg-2 { flex: 0 0 16.666667%; }
    .col-lg-4 { flex: 0 0 33.333333%; }
    .col-lg-8 { flex: 0 0 66.666667%; }
    .col-lg-10 { flex: 0 0 83.333333%; }
}

/* Tablet - 991px y menos */
@media (max-width: 991px) {
    .container {
        padding: 0 20px;
        max-width: 100%;
    }
    
    .row {
        margin: 0 -10px;
    }
    
    .row > [class*="col-"] {
        padding: 0 10px;
        margin-bottom: 15px;
    }
    
    .col-md-6 {
        width: 50%;
        flex: 0 0 50%;
    }
    
    .col-md-4 {
        width: 50%;
        flex: 0 0 50%;
    }
    
    .col-md-3, .col-md-8, .col-md-9 {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .visa-form-container {
        padding: 25px 20px;
        margin: 15px 0;
        border-radius: 12px;
    }
    
    .form-control {
        height: 50px;
        padding: 14px 16px;
        font-size: 16px;
    }
    
    select.form-control {
        padding: 14px 16px;
        height: 50px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 15px;
        margin-right: 0;
        padding: 14px 20px;
        min-height: 50px;
    }
}

/* Mobile - 767px y menos */
@media (max-width: 767px) {
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    .row {
        margin: 0;
        display: block;
    }
    
    .col-xs-3, .col-xs-6, .col-xs-9, .col-xs-12,
    .col-sm-3, .col-sm-5, .col-sm-7, .col-sm-9, .col-sm-12,
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9, .col-md-12 {
        padding: 0;
        width: 100%;
        display: block;
        margin-bottom: 15px;
        flex: none;
    }
    
    .form-control {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 14px 16px;
        height: 52px;
    }
    
    select.form-control {
        padding: 14px 16px;
        height: 52px;
        font-size: 16px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 15px;
        margin-right: 0;
        padding: 16px 20px;
        min-height: 52px;
        font-size: 16px;
    }
    
    .visa-form-container {
        padding: 20px 16px;
        margin: 10px 0;
    }
    
    .brand img {
        height: 32px;
    }
    
    #wb-lng {
        font-size: 12px;
        text-align: center;
        margin-top: 5px;
    }
    
    .step-section {
        padding-left: 0;
        text-align: center;
        margin-bottom: 40px;
    }
    
    .step-number {
        position: relative;
        margin: 0 auto 20px auto;
    }
    
    .immigration-links-section .col-md-4 {
        margin-bottom: 30px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    h3 {
        font-size: 1.3em;
    }
    
    .visa-form-container h2 {
        font-size: 1.6rem;
    }
    
    .visa-form-container h3 {
        font-size: 1.3rem;
    }
}

/* Mobile pequeño - 480px y menos */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .visa-form-container {
        padding: 16px 12px;
        margin: 8px 0;
    }
    
    .form-control {
        padding: 12px 14px;
        height: 48px;
        font-size: 16px;
    }
    
    select.form-control {
        padding: 12px 14px;
        height: 48px;
        font-size: 16px;
    }
    
    .btn {
        padding: 14px 16px;
        min-height: 48px;
        font-size: 16px;
    }
    
    .brand img {
        height: 28px;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    .visa-form-container h2 {
        font-size: 1.4rem;
    }
    
    .visa-form-container h3 {
        font-size: 1.2rem;
    }
    
    .checkbox label {
        font-size: 14px;
    }
    
    label, .control-label {
        font-size: 14px;
    }
}

/* Accessibility y mejoras táctiles */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .form-control:hover {
        border-color: inherit;
    }
    
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 4px;
    }
    
    .btn {
        min-height: 48px;
        padding: 14px 20px;
    }
    
    .checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Estilos de impresión */
@media print {
    .visa-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
        background: white;
    }
    
    .btn {
        display: none;
    }
    
    header, nav, footer {
        display: none;
    }
    
    .form-control {
        border: 1px solid #000;
        background: white;
    }
}