
  
  :root {
    /* Primary Colors */
    --color-primary: #006de4;
    --color-primary-hover: #0056b3;
    
    /* Text Colors */
    --color-text: #333333;
    --color-text-secondary: #555555;
    --color-text-muted: #666666;
    --color-text-light: #757575;
    
    /* Background Colors */
    --color-bg: #ffffff;
    --color-bg-light: #f5f5f5;
    --color-bg-lighter: #fafafa;
    --color-bg-hover: #f0f7ff;
    --color-bg-page-start: #f5f7fa;
    --color-bg-page-end: #c3cfe2;
    
    /* Border Colors */
    --color-border: #e0e0e0;
    --color-border-light: #e8e8e8;
    --color-border-input: #dddddd;
    
    /* Status Colors */
    --color-info-bg: #e7f3ff;
    --color-info-text: #0066cc;
    --color-success-bg: #e6f9e6;
    --color-success-text: #006600;
    --color-error-bg: #ffe6e6;
    --color-error-text: #cc0000;
    
    /* Disabled States */
    --color-disabled: #cccccc;
    --color-disabled-bg: rgba(0, 0, 0, 0.05);
  }
  * { box-sizing: border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--color-bg-page-start) 0%, var(--color-bg-page-end) 100%);
    min-height: 100vh;
    max-width: 700px;

    &.page--admin {
      max-width: none;
    }
  }
  .footer {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 1rem;
  }
  .footer a {
    color: var(--color-primary);
    text-decoration: none;
    display: block;
  }
  .footer a:hover {
    text-decoration: underline;
  }

  .footer-copyright {
    & p {
      text-align: center;
      font-size: 0.8em;
      margin: 1rem;
      color: var(--color-text-secondary);

      & a {
        &:link,
        &:active,
        &:visited,
        &:hover {
          color: var(--color-primary);
          text-decoration: none;
        }
      }
    }
  }

  .card {
    background: var(--color-bg);
    border-radius: 16px;
    padding: 32px;
    margin: 0 auto 20px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
  }
  .branding {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
  }
  .branding-logo {
    max-width: 100%;
    margin: 0 auto 12px;
    display: block;
  }
  .branding-tagline {
    font-size: 14px;
    color: var(--color-text-light);
    font-style: italic;
    margin-top: 8px;
  }
  h1 { font-size: 28px; font-weight: 600; color: var(--color-text); }
  h3 { margin: 0 0 16px 0; font-size: 20px; font-weight: 600; color: var(--color-text); }
  h4 { margin: 0 0 12px 0; font-size: 16px; font-weight: 600; color: var(--color-text); }
  .subtitle { color: var(--color-text-muted); margin: 0 0 20px 0; }
  input[type="email"], input[type="file"] {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 16px;
    background: var(--color-bg);
    transition: border-color 0.2s;
  }
  input[type="email"]:focus {
    outline: none;
    border-color: var(--color-primary);
  }
  .image-size-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  .radio-option {
    display: flex;
    align-items: center;
    padding: 12px 5px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-bg);
    flex: 1;
    justify-content: center;
    text-align: center;
  }
  .radio-option:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-hover);
  }
  .radio-option input[type="radio"] {
    margin: 0 8px 0 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    display: none;
  }
  .radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--color-primary);
  }
  .radio-option:has(input[type="radio"]:checked) {
    border-color: var(--color-primary);
    background: var(--color-bg-hover);
  }
  .radio-option > span {
    font-size: 15px;
    color: var(--color-text);

    & > .image-size-credit {
      font-size: 0.6em;
      color: var(--color-text-muted);
      display: block;

      & .value {
        margin-left: 0.25em;
      }
    }
  }
  button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, transform 0.1s;
  }
  button:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
  button:active { transform: translateY(0); }
  button:disabled { background: var(--color-disabled); cursor: not-allowed; transform: none; }
  button.secondary {
    background: var(--color-bg-light);
    color: var(--color-text);
  }
  button.secondary:hover { background: var(--color-border); }
  .status { 
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
  }
  .status.info { background: var(--color-info-bg); color: var(--color-info-text); }
  .status.success { background: var(--color-success-bg); color: var(--color-success-text); }
  .status.error { background: var(--color-error-bg); color: var(--color-error-text); }
  .status.loading {
    background: var(--color-info-bg);
    color: var(--color-primary);
    position: relative;
    overflow: hidden;
  }
  .status.loading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: shimmer 2s infinite;
    pointer-events: none;
  }
  @keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
  }
  .balance {
    display: flex;
    flex-flow: row wrap;
    gap: 1rem;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
  }
  .balance-container {
    flex: 1 1 auto;
  }
  .balance-amount { font-size: 20px; font-weight: 600; color: var(--color-text); }
  .balance-label { color: var(--color-text-secondary); font-size: 15px; font-weight: 500; }
  .add-credits-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    flex: 1 1 auto;

    & > * {
      flex: 1 1 auto;
    }
  }
  .add-credits-form {
    display: grid;
    gap: 8px;
    align-items: center;
    justify-content: center;
    grid-template-areas:
      "entry credits button"
      "value value button";
    
    & .entry {
      grid-area: entry;
      text-align: center;
      padding:8px;
      border:1px solid var(--color-border-input);
      border-radius:4px;
      font-size:14px;
    }

    & .credits {
      grid-area: credits;
      font-size:14px;
      color: var(--color-text-muted);
    }

    & .value {
      grid-area: value;
      font-size:14px;
      font-weight:bold;
      color: var(--color-primary);
      text-align: center;
    }

    & .button {
      grid-area: button;
      width:auto;
      align-self: center;
    }
  }
  .dropzone {
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
    background: var(--color-bg-lighter);
  }
  .dropzone:hover, .dropzone.dragover {
    border-color: var(--color-primary);
    background: var(--color-bg-hover);
    transform: translateY(-2px);
  }
  .dropzone input { display: none; }
  .preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin: 16px 0;
  }
  .result img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  .hidden { display: none; }
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 0;
    border-bottom: 1px solid var(--color-border-light);
  }
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .header span:first-child {
    font-weight: 500;
    color: var(--color-text);
  }
  .header > div {
    display: flex;
    gap: 16px;
    align-items: center;
  }
  .header a {
    font-size: 14px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
  }
  .header a:hover {
    background: var(--color-bg-hover);
    text-decoration: underline;
  }
  .logout { 
    font-size: 14px; 
    color: var(--color-text-muted); 
    cursor: pointer; 
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
  }
  .logout:hover { 
    color: var(--color-text); 
    background: var(--color-bg-hover);
  }
  .add-credits-container {
    display: flex;
    flex-flow: column wrap;
    gap: 8px;
    align-items: center;
    background-color: var(--color-disabled-bg);
    padding: 1rem;
    border-radius: 0.5rem;

    & h4 {
      margin: 0;
    }
  }

  .site-information {
    container-type: inline-size;
    & p,
    & li {
      line-height: 150%;
    }
  }

  @media (max-width: 768px) {
    body {
      padding: 0;
    }

    .card {
      border-radius: 0;
    }
    .add-credits-form {
      grid-template-areas:
        "entry credits"
        "value value"
        "button button";
    }

    .balance-container {
      flex: none;
    }
    .footer {
      padding: 1rem;
    }
  }


  /* Static page styles */
  .content {
    padding: 0;
  }
  .content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--color-text);
  }
  .content p {
    margin-bottom: 15px;
    color: var(--color-text-secondary);
  }
  .content ul, .content ol {
    margin-bottom: 15px;
    padding-left: 30px;
  }
  .content li {
    margin-bottom: 8px;
    color: var(--color-text-secondary);
  }
  .static-header {
    margin-bottom: 20px;
  }
  .static-header a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
  }
  .static-header a:hover {
    text-decoration: underline;
  }

  /* Gallery styles */
  .gallery-grid {
    columns: 2;
    column-gap: 1rem;
    margin-top: 1rem;
  }
  .gallery-item {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
  }
  .gallery-item:hover {
  }
  .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    background: var(--color-bg-light);
  }
  @media (max-width: 768px) {
    .gallery-grid {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 16px;
    }
  }

  /* Past hedcuts styles */
  .past-hedcuts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  .past-hedcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
  }
  .past-hedcuts-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
  }
  .past-hedcuts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
  }
  .past-hedcut-item {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    position: relative;
  }
  .past-hedcut-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  .past-hedcut-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
  }
  .past-hedcut-delete:hover {
    background: rgba(204, 0, 0, 0.9);
    transform: scale(1.1);
  }
  .past-hedcut-delete:active {
    transform: scale(0.95);
  }
  .past-hedcut-link {
    display: block;
    text-decoration: none;
    color: inherit;
  }
  .past-hedcut-link img {
    width: 100%;
    height: auto;
    display: block;
    background: var(--color-bg-light);
  }
  .past-hedcut-info {
    padding: 12px;
    background: var(--color-bg);
  }
  .past-hedcut-date {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
  }
  .past-hedcut-size {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
  }
  .no-hedcuts {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
    grid-column: 1 / -1;
  }
  .no-hedcuts p {
    margin-bottom: 16px;
  }
  .no-hedcuts a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
  }
  .no-hedcuts a:hover {
    text-decoration: underline;
  }
  .page-not-found {
    line-height: 150%;
    
    & h1 {
      text-align: center;
      text-transform: uppercase;
      letter-spacing: 0.1ch;
    }

    & figure {
      float: left;
      margin: 0 1rem 1rem 0;
      width: 40%;

      & img {
        width: 100%;
        height: auto;
        display: block;
      }

      & figcaption {
        font-style: italic;
        font-size: 0.8em;
        line-height: 100%
      }
    }

    & p {
      text-align: justify;
      &:last-child {
        clear: both;
      }
    }
  }

  .image-example {
    max-width: 50cqw;
    
    & img {
      width: 100%;
      height: auto;
      display: block;
    }
    
    & figcaption {
      font-style: italic;
      font-size: 0.8em;
      line-height: 100%
      margin-top: 0.5rem;
    }

    &.float-right {
      float: right;
      margin: 0 0 1rem 1rem;
    }

    &.float-left {
      float: left;
      margin: 0 1rem 1rem 0;
    }
  }
  @media (max-width: 768px) {
    .past-hedcuts-grid {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 16px;
    }
    .past-hedcuts-header {
      flex-direction: column;
      align-items: flex-start;
    }
  }

  /* Admin panel styles */
  .page-not-found {
    & figure {
      margin: 24px 0;
      text-align: center;
      
      & img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }
      
      & figcaption {
        margin-top: 12px;
        font-size: 14px;
        color: var(--color-text-secondary);
        font-style: italic;
      }
    }
  }

  table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    
    & thead {
      background: var(--color-bg-light);
      border-bottom: 2px solid var(--color-border);
    }
    
    & th {
      padding: 12px;
      text-align: left;
      font-weight: 600;
      color: var(--color-text);
    }
    
    & td {
      padding: 12px;
      border-bottom: 1px solid var(--color-border-light);
      color: var(--color-text-secondary);
      
      & a {
        color: var(--color-primary);
        text-decoration: none;
        
        &:hover {
          text-decoration: underline;
        }
      }
    }
    
    & tbody tr:last-child td {
      border-bottom: none;
    }
    
    & tbody tr:hover {
      background: var(--color-bg-lighter);
    }
  }
