* {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    max-width: 1450px;
    margin: 20px auto;
    background-color: #0f0b1d;
    /* animation: backgroundCycle 10s infinite alternate; */
}

main {
    width: 100%;
    padding: 0 25px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    font-size: 38px;
    font-weight: 700;
    color: #0a165e;
    text-align: center;
    margin: 0 0 35px;

    @media screen and (min-width: 768px) {
        font-size: 58px;        
    }

    .heading__gradient {
        display: inline-flex;
        margin: 0 auto;
        background: linear-gradient(90deg, #ff4f81, #a64eff, #4f9eff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: 800;
    }

    .heading__inner span {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: #ffffff;
        margin: 10px 0 0;
        text-transform: none;
    }
}

.heading h1+p {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #727279;
    margin: 10px 0 0;
    text-transform: none;
}

p {
    font-size: 16px;
    margin: 0 0 15px;
}

.main-content {
    display: inline-grid;
    grid-template-columns: 1fr;
    gap: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    @media screen and (min-width: 768px) {        
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        padding: 30px;
    }
}

.section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.section h2 {
    font-weight: 500;
    color: #374151;
    margin-top: 0;
}

h3 {
    margin: 0;
}

h4 {
    font-size: 18px;
    margin: 0 0 10px;
}

p+h4 {
    margin-top: 25px;
}

.heading-group {
    margin-bottom: 20px;    
    
    @media screen and (min-width: 768px) {
        display: flex;
        justify-content: space-between;
        align-items: center;    
    }
}

.overall-compliance {
    display: flex;
    gap: 10px;
    align-items: center;
    @media screen and (min-width: 768px) {
        text-align: right;
    }
}

.color-inputs {
    display: flex;
    gap: 0 25px;
    flex-wrap: wrap;
}

.color-input-group {
    margin-bottom: 20px;
}

.color-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.color-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker {
    width: 60px;
    height: 46px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    padding: 5px;
    border: 2px solid #dee2e6;
}

.color-picker[type="color" i]::-webkit-color-swatch {
    border-radius: 4px;
}

.color-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.color-input:focus {
    outline: none;
    border-color: #3498db;
}

.preset-colors {
    display: flex;
    display: none;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.preset-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.preset-color:hover {
    transform: scale(1.1);
}

.contrast-preview {
    background: white;
    border-radius: 12px;
    padding: 35px;
    border: 2px solid #e9ecef;
    text-align: center;
}

.preview-text {
    font-size: 1.2rem;
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 8px;

    +.preview-text {
        margin-bottom: 0;
    }
}

.contrast-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0 0;
    @media screen and (min-width: 768px) {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.contrast-result {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
}

.contrast-ratio {
    font-size: 4.15rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.contrast-ratio__label {
    color: #555555;
    font-weight: 500;
}

.wcag-level {
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 15px;
    font-weight: 600;
    margin: 4px auto 8px;
    max-width: 150px;
}

.pass {
    background: #d4edda;
    color: #155724;
}

.fail {
    background: #f8d7da;
    color: #721c24;
}

.colorblind-simulation {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
    
    @media screen and (min-width: 768px) { 
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

.simulation-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid #dee2e6;
}

.simulation-preview {
    max-width: 250px;
    height: 60px;
    border-radius: 8px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 30px;
}

.simulation-item__description {
    display: block;
}

.palette-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.palette-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #dee2e6;
}

.palette-colors {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
}

.palette-color {
    flex: 1;
    cursor: pointer;
    transition: transform 0.2s;
}

.palette-color:hover {
    transform: scaleY(1.1);
}

.btn {
    background: #0077c7;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    margin: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #7f8c8d;
}

.tabs {
    display: flex;
    background: #e9ecef;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.tab.active {
    background: white;
    color: #0077c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.full-width {
    grid-column: 1 / -1;
}

.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ctaad {
    position: relative;
    display: block;
    margin: 20px 0 0;
}

.ctaad__link {
    position: relative;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    background-color: white;
    color: #333333;
    text-decoration: none;
    width: 100%;
    max-width: 650px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    margin: auto;
    top: 0;
    transition: all .2s ease-in-out;
    overflow: hidden;

    &:hover,
    &:focus {
        top: -2px;
        box-shadow: 0 3px 12px rgba(52, 152, 219, 0.25);
    }
}

.ctaad__image {
    position: absolute;
    height: auto; 
    max-width: 140px;
    margin-right: 20px;
    object-fit: cover;
}

.ctaad__text {
    font-size: 16px;
    font-weight: 600;
    padding: 15px 20px 30px 160px;

    h2 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 18px;
        font-weight: 700;
    }

    p {
        &:last-of-type {
            margin-bottom: 0;
        }
    }
}

.ctaad__tag {
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 8px;
    text-transform: uppercase;
    background-color: #e9ecef;
    padding: 3px 10px;
    letter-spacing: 1px;
    border-top-left-radius: 4px;
}

footer {
    margin: 20px 30px;
}

.footer__text {
    text-align: right;
    font-size: 14px;
    color: white;

    a {
        color: white;
        font-weight: 700;
        text-decoration: none;
        &:hover, &:focus {
            opacity: .75;
            text-decoration: underline;
        }
    }
}

@keyframes backgroundCycle {
  0% {
    background-color: #0f0b1d;
  }
  50% {
    background-color: #352764;
  }
  100% {
    background-color: #3d449f;
  }
}
